mirror of https://github.com/marrub--/zscript-doc
add doc for special properties
parent
6bd64b1a3f
commit
0634ea76af
|
@ -11,9 +11,9 @@ Class Definitions
|
|||
* [Example: Property definitions](#example-property-definitions)
|
||||
* [Flag Definitions](#flag-definitions)
|
||||
* [Example: Flag definitions](#example-flag-definitions)
|
||||
* [Default Dlocks](#default-dlocks)
|
||||
* [Default flag](#default-flag)
|
||||
* [Default property](#default-property)
|
||||
* [Default Blocks](#default-blocks)
|
||||
* [Default Flag](#default-flag)
|
||||
* [Default Property](#default-property)
|
||||
* [State Definitions](#state-definitions)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
@ -243,7 +243,7 @@ class MyCoolActorWithFlags : Actor
|
|||
}
|
||||
```
|
||||
|
||||
Default Dlocks
|
||||
Default Blocks
|
||||
==============
|
||||
|
||||
Default blocks are used on classes derived from Actor to create an overridable
|
||||
|
@ -263,7 +263,7 @@ default
|
|||
|
||||
Default statements include either flags or properties:
|
||||
|
||||
## Default flag
|
||||
## Default Flag
|
||||
|
||||
Default flags are formed either:
|
||||
|
||||
|
@ -274,17 +274,29 @@ Default flags are formed either:
|
|||
|
||||
The former will enable the flag on this actor, the latter will disable it.
|
||||
|
||||
## Default property
|
||||
## Default Property
|
||||
|
||||
Default properties are formed as:
|
||||
|
||||
```
|
||||
Identifier $[ . Identifier]$... Expression ;
|
||||
Identifier $[ . Identifier]$ $[Expression]$ ;
|
||||
```
|
||||
|
||||
Note that all properties *except for* `DamageFunction` require `Expression` to
|
||||
be a constant expression.
|
||||
|
||||
There are several special properties which add pre-defined flag sets onto the
|
||||
actor. Here is a list of them:
|
||||
|
||||
| Name | Description |
|
||||
| ---- | ----------- |
|
||||
| `ClearFlags` | Clears all flags except `ARGSDEFINED`. |
|
||||
| `Monster` | Adds the flags `SHOOTABLE COUNTKILL SOLID PUSHWALL MCROSS PASSMOBJ ISMONSTER CANUSEWALLS`. |
|
||||
| `Projectile` | Adds the flags `NOBLOCKMAP NOGRAVITY DROPOFF MISSILE IMPACT PCROSS NOTELEPORT`, and if the game is Heretic or Hexen, `BLOODSPLATTER`. |
|
||||
|
||||
Note that like any other property, they require a semicolon after them,
|
||||
although they do not use an expression.
|
||||
|
||||
State Definitions
|
||||
=================
|
||||
|
||||
|
|
|
@ -112,11 +112,11 @@ A switch demonstrating fall-through and default cases.
|
|||
```
|
||||
switch(a)
|
||||
{
|
||||
case 500: Console.Printf("a is 500"); break;
|
||||
case 501: Console.Printf("a is 501"); // falls through to next case
|
||||
case 502: Console.Printf("a is 501 or 502"); break;
|
||||
case 500: Console.PrintF("a is 500"); break;
|
||||
case 501: Console.PrintF("a is 501"); // falls through to next case
|
||||
case 502: Console.PrintF("a is 501 or 502"); break;
|
||||
default:
|
||||
Console.Printf("not sure what a is!");
|
||||
Console.PrintF("not sure what a is!");
|
||||
// break is implied here
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue