111 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx) |
111 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx) |
112 </code> |
112 </code> |
113 |
113 |
114 == Ammo == |
114 == Ammo == |
115 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> === |
115 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> === |
116 This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` event handler. In other places, this function will not work. |
116 This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` [LuaEvents event handler]. In other places, this function will not work. |
117 |
117 |
118 In Lua missions, for *all* ammo types, the ammo count, probability, delay and number in crates is set to 0 initially. Note: This also includes skip! |
118 In Lua missions, for *all* ammo types, the ammo count, probability, delay and number in crates is set to 0 initially. Note: This also includes skip! |
119 |
119 |
120 Parameters: |
120 Parameters: |
121 |
121 |
171 <code language="lua"> |
171 <code language="lua"> |
172 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact |
172 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact |
173 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code> |
173 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code> |
174 |
174 |
175 === <tt>!AddAmmo(gearUid, ammoType, ammoCount)</tt> === |
175 === <tt>!AddAmmo(gearUid, ammoType, ammoCount)</tt> === |
176 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. `ammoCount` is an optional parameter. If this is set, the ammo will *not* be added, but instead set to `ammoCount`. A value of `0` will remove the weapon, a value of `AMMO_INFINITE` will give infinite ammo. |
176 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` [LuaEvents event handler]. `ammoCount` is an optional parameter. If this is set, the ammo will *not* be added, but instead set to `ammoCount`. A value of `0` will remove the weapon, a value of `AMMO_INFINITE` will give infinite ammo. |
177 |
177 |
178 Note: By default, ammo is per-team, so calling `AddAmmo` for a hedgehog will give the ammo for the whole team. The game flags `gfPerHogAmmo` and `gfSharedAmmo` change how ammo is managed in the game, so these game flags also affect `AddAmmo`. |
178 Note: By default, ammo is per-team, so calling `AddAmmo` for a hedgehog will give the ammo for the whole team. The game flags `gfPerHogAmmo` and `gfSharedAmmo` change how ammo is managed in the game, so these game flags also affect `AddAmmo`. |
179 |
179 |
180 === <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) === |
180 === <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) === |
181 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`. |
181 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`. |