Difference between revisions of "Lua:Flags"

From Fortress Forever Wiki
Jump to navigationJump to search
Line 35: Line 35:
 
local grenade = CastToGrenade( explode_entity )  
 
local grenade = CastToGrenade( explode_entity )  
 
if grenade:Type() == Grenade.kNormal then
 
if grenade:Type() == Grenade.kNormal then
 +
  ...
 +
end
 +
</pre></code>
 +
}}
 +
 +
{{Lua:FlagType
 +
|prefix=Damage
 +
|usage=Returns a specific damage type's ID; predominately used to detect fall damage
 +
|flags=
 +
{{Lua:Flag|Damage.kGeneric|Generic damage}}
 +
{{Lua:Flag|Damage.kCrush|Crushing damage (as in by an elevator or door)}}
 +
{{Lua:Flag|Damage.kBullet|Bullet damage}}
 +
{{Lua:Flag|Damage.kSlash|Unknown}}
 +
{{Lua:Flag|Damage.kBurn|Burn damage (maybe by pyro, maybe by trigger_hurt)}}
 +
{{Lua:Flag|Damage.kVehicle|Vehicle damage}}
 +
{{Lua:Flag|Damage.kFall|Fall damage}}
 +
{{Lua:Flag|Damage.kBlast|Blast damage}}
 +
{{Lua:Flag|Damage.kClub|Unknown}}
 +
{{Lua:Flag|Damage.kShock|Shock damage}}
 +
{{Lua:Flag|Damage.kSonic|Unknown}}
 +
{{Lua:Flag|Damage.kEnergyBeam|Unknown}}
 +
{{Lua:Flag|Damage.kPreventPhysForce|Unknown}}
 +
{{Lua:Flag|Damage.kNeverGib|Unknown}}
 +
{{Lua:Flag|Damage.kAlwaysGib|Unknown}}
 +
{{Lua:Flag|Damage.kDrown|Drowning damage}}
 +
{{Lua:Flag|Damage.kTimeBased|Unknown}}
 +
{{Lua:Flag|Damage.kParalyze|Unknown}}
 +
{{Lua:Flag|Damage.kNerveGas|Unknown}}
 +
{{Lua:Flag|Damage.kPoison|Unknown}}
 +
{{Lua:Flag|Damage.kRadiation|Unknown}}
 +
{{Lua:Flag|Damage.kDrownRecover|Unknown}}
 +
{{Lua:Flag|Damage.kAcid|Unknown}}
 +
{{Lua:Flag|Damage.kSlowBurn|Unknown}}
 +
{{Lua:Flag|Damage.kRemoveNoRagdoll|Unknown}}
 +
{{Lua:Flag|Damage.kPhysgun|Unknown; likely not applicable}}
 +
{{Lua:Flag|Damage.kPlasma|Unknown}}
 +
{{Lua:Flag|Damage.kAirboat|Likely not applicable}}
 +
{{Lua:Flag|Damage.kDissolve|Can be dealt by a trigger_hurt}}
 +
{{Lua:Flag|Damage.kBlastSurface|Unknown}}
 +
{{Lua:Flag|Damage.kDirect|Unknown}}
 +
{{Lua:Flag|Damage.kBuckshot|Unknown}}
 +
{{Lua:Flag|Damage.kGibCorpse|Unknown}}
 +
{{Lua:Flag|Damage.kShownHud|Unknown}}
 +
{{Lua:Flag|Damage.kNoPhysForce|Unknown}}
 +
|example=
 +
<code><pre>
 +
local damagetype = damageinfo:GetDamageType()
 +
if damagetype == Damage.kFall then
 
   ...
 
   ...
 
end
 
end

Revision as of 18:19, 18 December 2008

Team

Returns a specific team's ID

Flag Description
Team.kUnassigned The Unassigned team consists of players that have not picked a team)
Team.kSpectator Spectators
Team.kRed The Red team
Team.kBlue The Blue team
Team.kYellow The Yellow team
Team.kGreen The Green team

Example

local player = CastToPlayer( touch_entity ) 
if player:GetTeamId() == Team.kRed then
  ...
end

Grenade

Returns a specific grenade's ID

Flag Description
Grenade.kNormal Frag grenade (All classes except Scout and Civilian)
Grenade.kCaltrop Caltrop grenades are no longer in the game
Grenade.kNail Nail Grenade (Soldier)
Grenade.kMirv Mirv grenade (HWGuy and Demoman)
Grenade.kMirvlet The four mini-grenades that come out of the Mirv grenade (HWGuy and Demoman)
Grenade.kConc Concussion grenade (Scout and Medic)
Grenade.kNapalm Napalm grenade (Pyro)
Grenade.kGas Gas grenade (Spy)
Grenade.kEmp EMP grenade (Engineer)

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

Flag Description
Damage.kGeneric Generic damage
Damage.kCrush Crushing damage (as in by an elevator or door)
Damage.kBullet Bullet damage
Damage.kSlash Unknown
Damage.kBurn Burn damage (maybe by pyro, maybe by trigger_hurt)
Damage.kVehicle Vehicle damage
Damage.kFall Fall damage
Damage.kBlast Blast damage
Damage.kClub Unknown
Damage.kShock Shock damage
Damage.kSonic Unknown
Damage.kEnergyBeam Unknown
Damage.kPreventPhysForce Unknown
Damage.kNeverGib Unknown
Damage.kAlwaysGib Unknown
Damage.kDrown Drowning damage
Damage.kTimeBased Unknown
Damage.kParalyze Unknown
Damage.kNerveGas Unknown
Damage.kPoison Unknown
Damage.kRadiation Unknown
Damage.kDrownRecover Unknown
Damage.kAcid Unknown
Damage.kSlowBurn Unknown
Damage.kRemoveNoRagdoll Unknown
Damage.kPhysgun Unknown; likely not applicable
Damage.kPlasma Unknown
Damage.kAirboat Likely not applicable
Damage.kDissolve Can be dealt by a trigger_hurt
Damage.kBlastSurface Unknown
Damage.kDirect Unknown
Damage.kBuckshot Unknown
Damage.kGibCorpse Unknown
Damage.kShownHud Unknown
Damage.kNoPhysForce Unknown

Example

local damagetype = damageinfo:GetDamageType()
if damagetype == Damage.kFall then
  ...
end