Difference between revisions of "Lua:Flags"
From Fortress Forever Wiki
Jump to navigationJump to searchSqueek-10494 (talk | contribs) |
Squeek-10494 (talk | contribs) |
||
Line 111: | Line 111: | ||
player:AddAmmo( Ammo.kDetpack, 1 ) | player:AddAmmo( Ammo.kDetpack, 1 ) | ||
player:AddAmmo( Ammo.kManCannon, 1 ) | player:AddAmmo( Ammo.kManCannon, 1 ) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=EF | ||
+ | |usage=Returns a specific status effect's ID | ||
+ | |flags= | ||
+ | {{Lua:Flag|EF.kOnfire|[[:Category:Status_Effects#On_Fire|On Fire]] status effect}} | ||
+ | {{Lua:Flag|EF.kConc|[[:Category:Status_Effects#Concussed|Concussed]] status effect}} | ||
+ | {{Lua:Flag|EF.kGas|[[:Category:Status_Effects#Hallucinations|Hallucinati ons]] status effect}} | ||
+ | {{Lua:Flag|EF.kInfect|[[:Category:Status_Effects#Infected|Infected]] status effect}} | ||
+ | {{Lua:Flag|EF.kRadiotag|[[:Category:Status_Effects#Transmitting|Transmitting]] status effect}} | ||
+ | {{Lua:Flag|EF.kHeadshot|Headshot status effect}} | ||
+ | {{Lua:Flag|EF.kLegshot|[[:Category:Status_Effects#Crippled|Crippled]] status effect}} | ||
+ | {{Lua:Flag|EF.kTranq|[[:Category:Status_Effects#Tranquilized|Tranquilized]] status effect}} | ||
+ | {{Lua:Flag|EF.kCaltrop|Defunct}} | ||
+ | {{Lua:Flag|EF.kACSpinup|Assault Cannon spinup status effect}} | ||
+ | {{Lua:Flag|EF.kSniperrifle|Unknown}} | ||
+ | {{Lua:Flag|EF.kSpeedlua1|Custom speed effect 1}} | ||
+ | {{Lua:Flag|EF.kSpeedlua2|Custom speed effect 2}} | ||
+ | {{Lua:Flag|EF.kSpeedlua3|Custom speed effect 3}} | ||
+ | {{Lua:Flag|...|...}} | ||
+ | {{Lua:Flag|EF.kSpeedlua10|Custom speed effect 10}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | local player = CastToPlayer( player_entity ) | ||
+ | |||
+ | SPEED_MULTIPLIER = 2.0 | ||
+ | EFFECT_DURATION = -1 -- Infinite duration | ||
+ | ICON_DURATION = 0 | ||
+ | |||
+ | player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER ) | ||
</pre></code> | </pre></code> | ||
}} | }} | ||
[[Category:Lua]] | [[Category:Lua]] |
Revision as of 17:28, 20 December 2008
Team
Returns a specific team's ID
|
Example
local player = CastToPlayer( touch_entity )
if player:GetTeamId() == Team.kRed then
...
end
Grenade
Returns a specific grenade's ID
|
Example
local grenade = CastToGrenade( explode_entity )
if grenade:Type() == Grenade.kNormal then
...
end
Damage
Returns a specific damage type's ID; predominately used to detect fall damage
|
Example
local damagetype = damageinfo:GetDamageType()
if damagetype == Damage.kFall then
...
end
Ammo
Returns a specific ammo type's ID; predominately used to add or remove ammo from a player
|
Example
local player = CastToPlayer( player_entity )
player:AddAmmo( Ammo.kNails, 400 )
player:AddAmmo( Ammo.kShells, 400 )
player:AddAmmo( Ammo.kRockets, 400 )
player:AddAmmo( Ammo.kCells, 400 )
player:AddAmmo( Ammo.kDetpack, 1 )
player:AddAmmo( Ammo.kManCannon, 1 )
EF
Returns a specific status effect's ID
|
Example
local player = CastToPlayer( player_entity )
SPEED_MULTIPLIER = 2.0
EFFECT_DURATION = -1 -- Infinite duration
ICON_DURATION = 0
player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER )