myspace / Data /ClassDef-Ambient Life.lua
sirnii's picture
Upload 1816 files
b6a38d7 verified
raw
history blame
53.2 kB
-- ========== GENERATED BY ClassDef Editor (Ctrl-Alt-F3) DO NOT EDIT MANUALLY! ==========
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Carry",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "civ_Walk_Carry_Start",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Walk_Carry",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "civ_Walk_Carry_End",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "MoveStyle",
'name', "Move Style",
'items', function (self) return GetAnimationStyleCombo() end,
}),
PlaceObj('PropertyDefPoint', {
'category', "Ambient Life",
'id', "CarryDestination",
'name', "Destination",
'help', "Where the load needs to be carry to",
'extra_code', 'buttons = {{name = "View", func = function(self) ViewPos(self.CarryDestination) end}}, helper = "absolute_pos"',
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassConstDef', {
'name', "ToolEntity",
'type', "text",
'value', "Shanty_CardboardBox_Carry",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "GameInit",
'code', function (self)
local valid = IsValidEntity(self.ToolEntity)
if valid then
if HasCollisions(self.ToolEntity) then
StoreWarningSource(self, string.format("Spawn Tool '%s' has collision surfaces(or passability colliders) - they will bug the PF!", self.ToolEntity))
end
self:AttachCarryItem()
else
StoreErrorSource(self, string.format("Invalid ToolEntity '%s'!", self.ToolEntity))
end
end,
}),
PlaceObj('ClassMethodDef', {
'name', "OnEditorSetProperty",
'params', "prop_id, old_value, ged",
'code', function (self, prop_id, old_value, ged)
if prop_id == "ToolEntity" or prop_id == "ToolAttachOffset" or prop_id == "ToolColors" then
self:AttachCarryItem()
end
end,
}),
PlaceObj('ClassMethodDef', {
'name', "AttachCarryItem",
'code', function (self)
if not IsValidEntity(self.ToolEntity) then return end
if self.tool_attached then
self:DestroyAttaches(self.tool_attached.class)
end
local marker_attach = PlaceObject(self.ToolEntity)
if self.ToolColors then
marker_attach:SetColorization(self.ToolColors)
end
self:Attach(marker_attach, self:GetSpotBeginIndex(self.ToolSpot))
if self.ToolAttachOffset then
marker_attach:SetAttachOffset(self.ToolAttachOffset)
end
DoneObject(self.tool_attached)
self.tool_attached = PlaceObject(self.ToolEntity)
if self.ToolColors then
self.tool_attached:SetColorization(self.ToolColors)
end
if self.ToolAutoAttachMode then
self.tool_attached:SetAutoAttachMode(self.ToolAutoAttachMode)
end
self.tool_attached:SetPos(self:GetPos())
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
if self:IsToolDestroyed() then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetText",
'code', function (self)
local texts = AmbientLifeMarker.EditorGetText(self)
if self:IsToolDestroyed() then
texts = (texts and (texts .. "\n") or "") .. "Carry Item is destroyed!"
end
return texts
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetTextColor",
'code', function (self)
return self:IsToolDestroyed() and const.clrRed or AmbientLifeMarker.EditorGetTextColor(self)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Cower",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Standing_Fear",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1424,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'help', "Map states requirements for the AL marker to be active.",
'extra_code', "",
'default', set( "Conflict" ),
'items', function (self) return GetGameStateFilter() end,
'three_state', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerMale_01",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Defender_PlayAnimVariation",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "nw_Standing_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "AllowAL",
'name', "Allow AL",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set(),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('PropertyDefStringList', {
'category', "Ambient Life",
'id', "Groups",
'name', "Groups",
'item_default', "AL_Defender",
'items', function (self)
local items = table.keys2(Groups or empty_table, "sorted")
table.insert(items, 1, "Closest AmbientZoneMarker")
return items
end,
'default', {
"AL_Defender",
},
'arbitrary_value', true,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Commando_Foreign_01",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
Comment = "Complicated one - has its own Visit() and spawned unit",
DefParentClassList = {
"AmbientLifeMarker",
"GameDynamicDataObject",
},
group = "Ambient Life",
id = "AL_Football",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Ambient_PlayFootball",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "PartnerUnitDataDef",
'name', "Partner's Unit Data Def",
'items', function (self) return table.keys(UnitDataDefs, "sorted") end,
}),
PlaceObj('PropertyDefPoint', {
'category', "Ambient Life",
'id', "PartnerLocation",
'name', "Partner Location",
'help', "The other player to pass to",
'extra_code', 'buttons = {{name = "View", func = function(self) ViewPos(self.Partner) end}}, helper = "absolute_pos", helper_class = "PropertyHelper_AppearanceObjectAbsolutePos", use_object = true',
}),
PlaceObj('PropertyDefNumber', {
'category', "Ambient Life",
'id', "BallSpeedMin",
'name', "Ball Speed Min",
'help', "Minimum speed of the ball",
'default', 3000,
'scale', "m",
}),
PlaceObj('PropertyDefNumber', {
'category', "Ambient Life",
'id', "BallSpeedMax",
'name', "Ball Speed Max",
'help', "Maximum speed of the ball",
'default', 6000,
'scale', "m",
}),
PlaceObj('PropertyDefNumber', {
'category', "Ambient Life",
'id', "BallRPMMin",
'name', "Ball RPM Min",
'help', "Minimum RPM of the ball",
'default', 30,
}),
PlaceObj('PropertyDefNumber', {
'category', "Ambient Life",
'id', "BallRPMMax",
'name', "Ball RPM Max",
'help', "Maximum RPM of the ball",
'default', 80,
}),
PlaceObj('PropertyDefObject', {
'category', "Ambient Life",
'id', "unit",
'name', "Unit",
'help', "the visitor",
'dont_save', true,
'extra_code', "no_edit = true",
}),
PlaceObj('PropertyDefObject', {
'category', "Ambient Life",
'id', "partner",
'name', "Partner",
'help', "the actual unit - cloned from the visitor",
'dont_save', true,
'extra_code', "no_edit = true",
}),
PlaceObj('PropertyDefObject', {
'category', "Ambient Life",
'id', "ball",
'name', "Ball",
'help', "the ball - passed between the units",
'dont_save', true,
'extra_code', "no_edit = true",
}),
PlaceObj('PropertyDefObject', {
'category', "Ambient Life",
'id', "player_killed",
'name', "Player Killed",
'help', "the ball - passed between the units",
'dont_save', true,
'extra_code', "no_edit = true",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "Despawn",
'code', function (self)
if IsValid(self.unit) then
self.unit:SetBehavior()
self.unit:SetCommand("Idle")
end
if IsValid(self.partner) then
DoneObject(self.partner)
self.partner = false
end
if IsValid(self.ball) then
DoneObject(self.ball)
self.ball = false
end
AmbientLifeMarker.Despawn(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "StartVisit",
'params', "unit",
'code', function (self, unit)
self:SpawnTool(unit)
self.ball = PlaceObject("Shanty_Ball_01")
unit:Attach(self.ball, unit:GetSpotBeginIndex("Ball1"))
self.unit = unit
self:SpawnPartner()
self.partner:Face(unit)
unit:Face(self.partner)
self:SetVisitAnimation(unit)
if unit.perpetual_marker then
local phase = self:Random(unit:TimeToMoment(1, "hit"))
unit:SetPhaseHighLevel(phase)
end
end,
}),
PlaceObj('ClassMethodDef', {
'name', "SpawnPartner",
'params', "unit",
'code', function (self, unit)
if IsValid(self.partner) then return end
local unit_def = UnitDataDefs[self.PartnerUnitDataDef]
local pers_session_id = (unit_def and (unit_def.PersistentSessionId or "") ~= "") and unit_def.PersistentSessionId
local session_id = pers_session_id or GenerateUniqueUnitDataId("AmbientSpawnDef", gv_CurrentSectorId or "A1", "ClonedFootballPartner")
local unitdatadef_id = unit_def and unit_def.id or self.unit.unitdatadef_id
self.partner = SpawnUnit(unitdatadef_id, session_id)
CheckUniqueSessionId(self.partner)
self.partner.zone = self
self.partner:SetSide("neutral")
self.partner.routine_spawner = self.unit.routine_spawner
local appearance = ChooseUnitAppearance(unitdatadef_id, self.partner.handle)
self.partner:ApplyAppearance(appearance)
self.partner:SetState("civ_Standing_Idle")
self.partner:SetPos(self.PartnerLocation)
self.partner:SetCommand(false)
self.partner.SetCommand = empty_func
end,
}),
PlaceObj('ClassMethodDef', {
'name', "SetDynamicData",
'params', "data",
'code', function (self, data)
self.partner = data.partner and HandleToObject[data.partner] or false
if not IsKindOf(self.partner, "Unit") then
self.partner = false
end
if self.partner then
if not self:IsPartnerDead() then
self.partner:SetCommand(false)
self.partner.SetCommand = empty_func
end
end
self.player_killed = data.player_killed or false
end,
}),
PlaceObj('ClassMethodDef', {
'name', "GetDynamicData",
'params', "data",
'code', function (self, data)
data.partner = self.partner and self.partner.handle or nil
data.player_killed = self.player_killed or nil
end,
}),
PlaceObj('ClassMethodDef', {
'name', "Visit",
'params', "unit, dest, lookat",
'code', function (self, unit, dest, lookat)
dest = dest or self:GetPos()
-- going to the marker spot
if not self:GotoEnterSpot(unit, dest) then return end
-- prepare the unbreakable exit from the marker
local tool
unit:PushDestructor(function()
if self.perpetual_unit then
self.perpetual_unit = false
end
unit:FreeVisitable()
if not IsValid(unit) then return end
self:ExitVisit(unit)
if not self:IsPartnerDead() then
DoneObject(self.partner)
self.partner = false
end
DoneObject(self.ball)
self.ball = false
end)
local start_time = GameTime()
self:Enter(unit, dest, lookat)
local visit_duration = GameTime() - start_time
if self.VisitMinDuration and visit_duration >= self.VisitMinDuration then return end
-- actual visit
self:StartVisit(unit)
repeat
local start_time = GameTime()
if IsValid(unit) and not self:IsPartnerDead() then
local _, ball_spot_index = unit:GetRandomAnim(self.VisitIdle)
self:PlayBall(unit, self.partner, ball_spot_index)
end
if IsValid(unit) and not self:IsPartnerDead() then
local _, ball_spot_index = self.partner:GetRandomAnim(self.VisitIdle)
self:PlayBall(self.partner, unit, ball_spot_index)
end
Sleep(50 + self:Random(50))
visit_duration = visit_duration + (GameTime() - start_time)
until self:IsPartnerDead() or (self.perpetual_unit and self.perpetual_unit ~= unit) or (self.VisitMinDuration and visit_duration >= self.VisitMinDuration)
-- unbreakable exit from the marker
unit:PopAndCallDestructor()
end,
}),
PlaceObj('ClassMethodDef', {
'name', "PlayBall",
'params', "unit, partner, ball_spot_index",
'code', function (self, unit, partner, ball_spot_index)
Sleep(unit:TimeToMoment(1, "hit") or 0)
self.ball:Detach()
if not self:IsPartnerDead() then
self:ShootBall(partner, ball_spot_index, unit, unit:TimeToAnimEnd())
end
end,
}),
PlaceObj('ClassMethodDef', {
'name', "IsPartnerDead",
'code', function (self)
return IsValid(self.partner) and self.partner:IsDead()
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetText",
'code', function (self)
if self.player_killed then
return "AL CAN'T Visit(Inactive do the dead player)"
end
return AmbientLifeMarker.EditorGetText(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetTextColor",
'code', function (self)
if self.player_killed then
return const.clrRed
end
return AmbientLifeMarker.EditorGetTextColor(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
if self.player_killed or not IsValid(self.partner) then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "ShootBall",
'params', "target, ball_spot_index, ball_dest, kicker, kicker_time_end",
'code', function (self, target, ball_spot_index, ball_dest, kicker, kicker_time_end)
if target:GetEnumFlags(const.efVisible) ~= 0 then
self.ball:SetEnumFlags(const.efVisible)
else
self.ball:ClearEnumFlags(const.efVisible)
end
local target_spot = "Ball" .. ball_spot_index
local ball_spot = target:GetSpotBeginIndex(target_spot)
local ball_dest = target:GetSpotPos(ball_spot)
local ball_start = self.ball:GetPos()
local ball_dir = ball_dest - ball_start
local ball_speed = self.BallSpeedMin + self:Random(self.BallSpeedMax - self.BallSpeedMin)
local ball_travel_time = MulDivTrunc(ball_dir:Len(), 1000, ball_speed)
local rpm = self.BallRPMMin * 360+ self:Random((self.BallRPMMax - self.BallRPMMin) * 360)
local angle = MulDivTrunc(rpm, ball_travel_time, 1000)
local axis = Rotate(ball_dir, 90 * 60)
self.ball:SetAxis(axis)
self.ball:SetPos(ball_dest, ball_travel_time)
local suffix = (ball_spot_index == 1) and "" or tostring(ball_spot_index)
local target_football_anim = self.VisitIdle .. suffix
local recieve_moment = target:GetAnimMoment(target_football_anim, "start")
ball_travel_time = (ball_travel_time < recieve_moment) and recieve_moment or ball_travel_time
local target_time_recieve = ball_travel_time - recieve_moment
local time, dt_sleep = 0, 10
while not self:IsPartnerDead() and time < ball_travel_time do
local dt = Min(dt_sleep, ball_travel_time - time)
dt = kicker_time_end and Min(dt, kicker_time_end - time) or dt
dt = target_time_recieve and Min(dt, target_time_recieve - time) or dt
self.ball:SetAngle(self.ball:GetAngle() + MulDivTrunc(dt, angle, ball_travel_time))
Sleep(dt)
time = time + dt
if kicker_time_end and time >= kicker_time_end then
local idle_base = (self:Random(100) < 50) and "civ_Standing_Idle" or "civ_Standing_IdlePassive"
local idle_anim = kicker:GetNearbyUniqueRandomAnim(idle_base)
kicker:SetState(idle_anim)
kicker_time_end = false
end
if target_time_recieve and time >= target_time_recieve then
target:SetState(target_football_anim)
target_time_recieve = false
end
end
self.ball:SetAxis(axis_z)
self.ball:SetPos(ball_dest)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "OnHelperCreated",
'params', "helper",
'code', function (self, helper)
helper:ApplyAppearance(self.Appearance)
end,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Smiley",
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 2020,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Maraud",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Ambient_FindSomething",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "IgnoreGroupsMatch",
'value', true,
}),
PlaceObj('PropertyDefObject', {
'id', "corspe",
'name', "Corspe",
'dont_save', true,
'read_only', true,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
if unit.ImportantNPC then
return false
end
if self.corpse and unit:GetSide() == "neutral" then
if not IsKindOf(self.corpse, "Unit") then
-- Somehow Units becomes an ItemDropContainer
return false
end
local side = self.corpse:GetSide()
if not (side == "enemy1" or side == "enemy2" or side == "player1" or side == "player2") then
return false
end
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetText",
'code', function (self)
if not IsValid(self.corpse) then
return "AL CAN'T Visit(Corpse is missing)"
end
if not IsKindOf(self.corpse, "Unit") then
return "AL CAN'T Visit(Corpse is not Unit?!?)"
end
return AmbientLifeMarker.EditorGetText(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetTextColor",
'code', function (self)
if not IsValid(self.corpse) or not IsKindOf(self.corpse, "Unit") then
return const.clrRed
end
return AmbientLifeMarker.EditorGetTextColor(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "GetDynamicData",
'params', "data",
'code', function (self, data)
data.corpse = self.corpse and self.corpse.handle or false
end,
}),
PlaceObj('ClassMethodDef', {
'name', "SetDynamicData",
'params', "data",
'code', function (self, data)
self.corpse = data.corpse and HandleToObject[data.corpse] or false
end,
}),
PlaceObj('ClassMethodDef', {
'name', "OnVisitAnimEnded",
'params', "unit",
'code', function (self, unit)
local item = self.corpse:FindItemInSlot("InventoryDead", function(item, self)
if IsKindOf(item, "Valuables") then
if self:Random(100) < item.drop_chance then
return item
end
end
end, self)
if not item then
item = self.corpse:FindItemInSlot("InventoryDead", function(item, self)
if not IsKindOf(item, "Valuables") then
if self:Random(100) < item.drop_chance then
return item
end
end
end, self)
end
if item then
self.corpse:RemoveItem("InventoryDead", item)
unit:AddItem("Inventory", item)
CreateFloatingText(unit:GetVisualPos(), T(911186423849, "Picked up something"))
end
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_MineWorkPick",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Work_Pick",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "ToolEntity",
'type', "text",
'value', "Mine_PickAxe",
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_MineWorkShovel",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Work_Shovel",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "ToolEntity",
'type', "text",
'value', "Mine_Shovel",
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 8154,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_MineWorkSift",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Work_Sift",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "ToolEntity",
'type', "text",
'value', "Mine_WoodenTray",
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 8154,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Mourn",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Ambient_SadCrying",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1312,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "IgnoreGroupsMatch",
'value', true,
}),
PlaceObj('PropertyDefObject', {
'id', "corspe",
'name', "Corspse",
'dont_save', true,
'read_only', true,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
if unit.ImportantNPC then
return false
end
if self.corpse and unit:GetSide() == "neutral" then
if not IsKindOf(self.corpse, "Unit") then
-- Somehow Units becomes an ItemDropContainer
return false
end
local side = self.corpse:GetSide()
if side == "enemy1" or side == "enemy2" or side == "neutral" then
return false
end
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetText",
'code', function (self)
if not IsValid(self.corpse) then
return "AL CAN'T Visit(Corpse is missing)"
end
if not IsKindOf(self.corpse, "Unit") then
return "AL CAN'T Visit(Corpse is not Unit?!?)"
end
return AmbientLifeMarker.EditorGetText(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorGetTextColor",
'code', function (self)
if not IsValid(self.corpse) or not IsKindOf(self.corpse, "Unit") then
return const.clrRed
end
return AmbientLifeMarker.EditorGetTextColor(self)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "GetDynamicData",
'params', "data",
'code', function (self, data)
data.corpse = self.corpse and self.corpse.handle or false
end,
}),
PlaceObj('ClassMethodDef', {
'name', "SetDynamicData",
'params', "data",
'code', function (self, data)
self.corpse = data.corpse and HandleToObject[data.corpse] or false
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_PlayAnimVariation",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "nw_Standing_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Prostitute_Idle",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Seduce_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerFemale_01",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist) and unit:IsProstitute()
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Prostitute_Parade",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Seduce_Parade",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 11477,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerFemale_01",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist) and unit:IsProstitute()
end,
}),
})
PlaceObj('ClassDef', {
Comment = "Roam among such markers in the zone",
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Roam",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Standing_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "DontReorient",
'name', "Don't Reorient",
'help', "Does not reorient the unit to marker position",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerFemale_01",
}),
PlaceObj('ClassMethodDef', {
'name', "ApplyAppearance",
'params', "appearance, force",
'code', function (self, appearance, force)
AppearanceObject.ApplyAppearance(self, appearance, force)
local clr = const.clrGreen
self:SetColorModifier(clr)
for _, part in ipairs(self.parts) do
part:SetColorModifier(clr)
end
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_SitChair",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "civ_Sit_Start",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Sit_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "civ_Sit_End",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "EditorMarkerVisitAnim",
'name', "Editor Marker Visit Anim",
'default', "editorMarkerAnim_Sit",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 16,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassConstDef', {
'name', "VisitSupportCollectionVME",
'value', true,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
local enemy, dist = GetNearestEnemy(unit, "ignore awareness")
if enemy and dist <= const.AmbientLife.ForbidSitChairEnemyDist then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AL_SitChair",
},
group = "Ambient Life",
id = "AL_SitChair_SleepingAtTable",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "civ_Ambient_SleepingAtTable_Start",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Ambient_SleepingAtTable",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "civ_Ambient_SleepingAtTable_End",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "EditorMarkerVisitAnim",
'name', "Editor Marker Visit Anim",
'default', "editorMarkerAnim_Sit",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 16,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassConstDef', {
'name', "VisitSupportCollectionVME",
'value', true,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
local enemy, dist = GetNearestEnemy(unit, "ignore awareness", dont_check_dist)
if enemy and dist <= const.AmbientLife.ForbidSitChairEnemyDist then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_Talk",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "nw_Standing_IdlePassive",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitAlternate",
'name', "During Visit Alternate",
'help', 'There is some chance to play this animation instead of the original "During Visit" one',
'extra_code', "no_edit = function(self) return self.VisitAlternateChance == 0 end",
'default', "civ_Talking",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 8866,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "VisitAlternateVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "VisitAlternateChance",
'type', "number",
'value', 50,
}),
PlaceObj('ClassConstDef', {
'name', "EmotionChance",
'type', "number",
'value', 10,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerMale_02",
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
"GroundAlignedObj",
},
group = "Ambient Life",
id = "AL_WallLean",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "civ_Wall_Start",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Wall_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "civ_Wall_End",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "EditorMarkerVisitAnim",
'name', "Editor Marker Visit Anim",
'default', "editorMarkerAnim_Wall",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 16,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassConstDef', {
'name', "VisitSupportCollectionVME",
'value', true,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
local enemy, dist = GetNearestEnemy(unit, "ignore awareness")
if enemy and dist <= const.AmbientLife.ForbidWallLeanEnemyDist then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackPlace",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackPlace(self, ...)
AmbientLifeMarker.EditorCallbackPlace(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackRotate",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackRotate(self, ...)
AmbientLifeMarker.EditorCallbackRotate(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackScale",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackScale(self, ...)
AmbientLifeMarker.EditorCallbackScale(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackMove",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackMove(self, ...)
AmbientLifeMarker.EditorCallbackMove(self, ...)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_WallLean_NoSnap",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "civ_Wall_Start",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Wall_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "civ_Wall_End",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefBool', {
'category', "Ambient Life",
'id', "Teleport",
'name', "Teleport",
}),
PlaceObj('PropertyDefSet', {
'category', "Ambient Life",
'id', "GameStatesFilter",
'name', "States Required for Activation",
'extra_code', "",
'default', set({
Conflict = false,
}),
'items', function (self) return GetGameStateFilter end,
'three_state', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "EditorMarkerVisitAnim",
'name', "Editor Marker Visit Anim",
'default', "editorMarkerAnim_Wall",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 16,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "Legion_Jose",
}),
PlaceObj('ClassConstDef', {
'name', "VisitSupportCollectionVME",
'value', true,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
local enemy, dist = GetNearestEnemy(unit, "ignore awareness")
if enemy and dist <= const.AmbientLife.ForbidWallLeanEnemyDist then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
"GroundAlignedObj",
},
group = "Ambient Life",
id = "AL_WallLean_Prostitute",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "civ_Seduce_Wall",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 3267,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('ClassConstDef', {
'name', "Appearance",
'type', "text",
'value', "VillagerFemale_01",
}),
PlaceObj('ClassConstDef', {
'name', "VisitSupportCollectionVME",
'value', true,
}),
PlaceObj('ClassMethodDef', {
'name', "CanVisit",
'params', "unit, for_perpetual, dont_check_dist",
'code', function (self, unit, for_perpetual, dont_check_dist)
if not unit:IsProstitute() then
return false
end
local enemy, dist = GetNearestEnemy(unit, "ignore awareness")
if enemy and dist <= const.AmbientLife.ForbidWallLeanEnemyDist then
return false
end
return AmbientLifeMarker.CanVisit(self, unit, for_perpetual, dont_check_dist)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackPlace",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackPlace(self, ...)
AmbientLifeMarker.EditorCallbackPlace(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackRotate",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackRotate(self, ...)
AmbientLifeMarker.EditorCallbackRotate(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackScale",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackScale(self, ...)
AmbientLifeMarker.EditorCallbackScale(self, ...)
end,
}),
PlaceObj('ClassMethodDef', {
'name', "EditorCallbackMove",
'params', "...",
'code', function (self, ...)
AlignedObj.EditorCallbackMove(self, ...)
AmbientLifeMarker.EditorCallbackMove(self, ...)
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_WeaponAim",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "ar_Standing_Aim",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "Weapon",
'name', "Weapon",
'extra_code', "",
'default', "DoubleBarrelShotgun",
'items', function (self) return InventoryItemWeaponsCombo end,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})
PlaceObj('ClassDef', {
DefParentClassList = {
"AmbientLifeMarker",
},
group = "Ambient Life",
id = "AL_WeaponIdle",
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitEnter",
'name', "Entering Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitIdle",
'name', "During Visit",
'default', "ar_Standing_Idle",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "VisitExit",
'name', "Exit Visit",
'default', "",
'items', function (self) return GetStates("Male") end,
}),
PlaceObj('ClassConstDef', {
'name', "VisitPose",
'type', "number",
'value', 1912,
}),
PlaceObj('ClassConstDef', {
'name', "VisitVariation",
'value', true,
}),
PlaceObj('PropertyDefCombo', {
'category', "Ambient Life",
'id', "Weapon",
'name', "Weapon",
'extra_code', "",
'default', "DoubleBarrelShotgun",
'items', function (self) return InventoryItemWeaponsCombo end,
}),
PlaceObj('ClassMethodDef', {
'name', "GenerateVisitable",
'code', function (self)
local pos = self:GetPos()
local lookat = pos + Rotate(point(const.SlabSizeX, 0), self:GetAngle())
return {self, pos, lookat}
end,
}),
})