|
|
|
|
|
UndefineClass('Blinded') |
|
DefineClass.Blinded = { |
|
__parents = { "CharacterEffect" }, |
|
__generated_by_class = "CharacterEffectCompositeDef", |
|
|
|
|
|
object_class = "CharacterEffect", |
|
unit_reactions = { |
|
PlaceObj('UnitReaction', { |
|
Event = "OnBeginTurn", |
|
Handler = function (self, target) |
|
if not target:IsDead() then |
|
EnvEffectTearGasTick(target, nil, "start turn") |
|
if target:IsMerc() then |
|
PlayVoiceResponse(target, "GasAreaSelection") |
|
else |
|
PlayVoiceResponse(target, "AIGasAreaSelection") |
|
end |
|
end |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnEndTurn", |
|
Handler = function (self, target) |
|
if not target:IsDead() then |
|
EnvEffectTearGasTick(target, nil, "end turn") |
|
end |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnCalcChanceToHit", |
|
Handler = function (self, target, attacker, action, attack_target, weapon1, weapon2, data) |
|
if target == attacker then |
|
ApplyCthModifier_Add(self, data, self:ResolveValue("cth_effect")) |
|
end |
|
end, |
|
}), |
|
PlaceObj('UnitReaction', { |
|
Event = "OnCheckForceMinSight", |
|
Handler = function (self, target, observer, other, step_pos, darkness) |
|
if target == observer then |
|
return true |
|
end |
|
end, |
|
}), |
|
}, |
|
DisplayName = T(629298563884, "Blinded"), |
|
Description = T(595664130748, "Reduced <em>Sight range</em> and <em>Accuracy</em>. Can cause <em>Panic</em>."), |
|
AddEffectText = T(880622931884, "<em><DisplayName></em> is blinded"), |
|
OnAdded = function (self, obj) |
|
self:SetParameter("blinded_start_time", GameTime()) |
|
if IsMerc(obj) then |
|
PlayVoiceResponse(obj, "GasAreaSelection") |
|
else |
|
PlayVoiceResponse(obj, "AIGasAreaSelection") |
|
end |
|
end, |
|
type = "Debuff", |
|
Icon = "UI/Hud/Status effects/blinded", |
|
RemoveOnSatViewTravel = true, |
|
RemoveOnCampaignTimeAdvance = true, |
|
Shown = true, |
|
HasFloatingText = true, |
|
} |
|
|
|
|