GearTypes.wiki
changeset 879 b82b228bd0f1
parent 857 ca7261b5c679
child 880 edb64d05684e
equal deleted inserted replaced
878:d0a0d8167895 879:b82b228bd0f1
   106 This is a list of gears which usually stay on the land for a long time and stay for several rounds and can’t normally directly placed by players.
   106 This is a list of gears which usually stay on the land for a long time and stay for several rounds and can’t normally directly placed by players.
   107 
   107 
   108 ==== `gtCase` ====
   108 ==== `gtCase` ====
   109 An ammo, utility or health crate.
   109 An ammo, utility or health crate.
   110 
   110 
   111  * `Pos`: Crate type: 1=ammo crate, 2=health crate, 4=utility crate
   111 If the crate has just been collected, the gear state flag `gmDestroy` will be set before `onGearDelete` is called.
       
   112 
       
   113  * `Pos`: Crate type: 1=ammo crate, 2=health crate, 4=utility crate (also see below)
   112  * `Tag`: Used for the appear animation
   114  * `Tag`: Used for the appear animation
   113  * `Health`: Amount of health contained in a health crate
   115  * `Health`: Amount of health contained in a health crate
   114  * `Boom`: Explosion size and damage (default: 25)
   116  * `Boom`: Explosion size and damage (default: 25)
       
   117 
       
   118 We recommend you to use `SpawnAmmoCrate` and the like to crate crate gears instead of `AddGear`. Also note that `SpawnAmmoCrate` and `SpawnUtilityCrate` are the only way to set a crate's ammo in Lua, it can not be changed or read afterwards.
       
   119 
       
   120 Advanced crate types: If you just care about normal crates, the values 1, 2 and 4 mentioned above are all you need to know. Hedgewars supports a few crate variants which can be spawned with `SpawnFakeAmmoCrate` and the like. The `Pos` parameter is in reality a sum of several flags which need to be added up for the final type.
       
   121 || *Pos flag* || *Meaning* ||
       
   122 || `0x1` || Ammo crate ||
       
   123 || `0x2` || Health crate ||
       
   124 || `0x4` || Utility crate ||
       
   125 || `0x8` || Fake crate, looks like a normal crate but does not actually contain health or ammo ||
       
   126 || `0x10` || Cate has a booby trap, when the player collects this crate it will explode ||
       
   127 || `0x20` || Poison trap: When the player collects this crate the player will be poisoned ||
       
   128 
       
   129 All crates *must* have exactly one of the flags `0x1`, `0x2` or `0x4` set. Everything else can be combined at will.
       
   130 
       
   131 Examples:
       
   132 * Pos = 0x1: Ammo crate
       
   133 * Pos = 0x9: Fake ammo crate (0x1 + 0x8)
       
   134 * Pos = 0x2A: Fake health crate with poison trap (0x2 + 0x8 + 0x20)
   115 
   135 
   116 ==== `gtExplosives` ====
   136 ==== `gtExplosives` ====
   117 An explosive barrel. It has its own invisible health, like a hedgehog. On low health levels smoke comes out of the barrel.
   137 An explosive barrel. It has its own invisible health, like a hedgehog. On low health levels smoke comes out of the barrel.
   118 
   138 
   119  * `Health`: “health” of the barrel: Starts at 60, explodes at 0.
   139  * `Health`: “health” of the barrel: Starts at 60, explodes at 0.
   198 
   218 
   199 The gear state flag `gstCollision` is set when the previous rope shot has hit something and is reset each time a new hook it fired.
   219 The gear state flag `gstCollision` is set when the previous rope shot has hit something and is reset each time a new hook it fired.
   200 
   220 
   201  * `X` and `Y`: Position of the nearest “bending point” of the rope (nearest to the rope gun), or the rope hook if rope does not touch anything
   221  * `X` and `Y`: Position of the nearest “bending point” of the rope (nearest to the rope gun), or the rope hook if rope does not touch anything
   202  * `dX`: sine of rope angle, number between -1000000 and 1000000 (correspond to -180° to 180°)
   222  * `dX`: sine of rope angle, number between -1000000 and 1000000 (correspond to -180° to 180°)
   203  * `dY`: negative cosine of rope angle, expressed as number between 0 and 10000000
   223  * `dY`: negative cosine of rope angle, expressed as number between 0 and 1000000
   204  * `Elasticity`: If the hog is attached to a rope, or is busy firing one, the elasticity of the rope will be non-rezo. A non-zero number holds the current retracted length of the rope from the nearest “bending point” or the hook, times 10000
   224  * `Elasticity`: If the hog is attached to a rope, or is busy firing one, the elasticity of the rope will be non-rezo. A non-zero number holds the current retracted length of the rope from the nearest “bending point” or the hook, times 10000
   205  * `Friction`: Holds the maximum remaning length of the rope measured from the nearest “bending point” or the hook, times 10000. Set this after rope creation to manually set the rope length individually. Note you can set `RopePercent` in `onGameInit` to set the rope length for all ropes at once
   225  * `Friction`: Holds the maximum remaning length of the rope measured from the nearest “bending point” or the hook, times 10000. Set this after rope creation to manually set the rope length individually. Note you can set `RopePercent` in `onGameInit` to set the rope length for all ropes at once
   206  * `Tag` Rope style: `0`=classic white segments (default), `1`=simple line which can be colored with `Tint`.
   226  * `Tag` Rope style: `0`=classic white segments (default), `1`=simple line which can be colored with `Tint`.
   207  * `Tint`: Rope color as RGBA. This only works if `Tag` equals `1`
   227  * `Tint`: Rope color as RGBA. This only works if `Tag` equals `1`
       
   228 
       
   229 Note: `dX` and `dY` are returned by the `GetGearVelocity` function.
   208 
   230 
   209 ==== `gtSwitcher` ====
   231 ==== `gtSwitcher` ====
   210 Switch hedgehog.
   232 Switch hedgehog.
   211 
   233 
   212 ==== `gtTardis` ====
   234 ==== `gtTardis` ====