Cleaning MP handlers

This commit is contained in:
Pao
2023-02-10 01:30:33 +01:00
parent 65ca3d285e
commit dad01605d0
15 changed files with 320 additions and 241 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<animNode> <animNode>
<m_Name>aim_default</m_Name> <m_Name>aim_default</m_Name>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName> <m_AnimName>Bob_Sit_FishingIdle</m_AnimName>
<m_Priority>4</m_Priority> <m_Priority>4</m_Priority>
<m_deferredBoneAxis>Y</m_deferredBoneAxis> <m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_SyncTrackingEnabled>false</m_SyncTrackingEnabled> <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
@@ -15,21 +15,21 @@
</m_Conditions> </m_Conditions>
<m_Transitions> <m_Transitions>
<m_Target>Idle</m_Target> <m_Target>Idle</m_Target>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName> <m_AnimName>Bob_Sit_FishingIdle</m_AnimName>
<m_blendInTime>0.3</m_blendInTime> <m_blendInTime>0.3</m_blendInTime>
<m_blendOutTime>0.3</m_blendOutTime> <m_blendOutTime>0.3</m_blendOutTime>
<m_speedScale>1.2</m_speedScale> <m_speedScale>1.2</m_speedScale>
</m_Transitions> </m_Transitions>
<m_Transitions> <m_Transitions>
<m_Target>sneakIdle</m_Target> <m_Target>sneakIdle</m_Target>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName> <m_AnimName>Bob_Sit_FishingIdle</m_AnimName>
<m_blendInTime>0.3</m_blendInTime> <m_blendInTime>0.3</m_blendInTime>
<m_blendOutTime>0.3</m_blendOutTime> <m_blendOutTime>0.3</m_blendOutTime>
<m_speedScale>1.2</m_speedScale> <m_speedScale>1.2</m_speedScale>
</m_Transitions> </m_Transitions>
<m_Transitions> <m_Transitions>
<m_Target>sneakIdleLow</m_Target> <m_Target>sneakIdleLow</m_Target>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName> <m_AnimName>Bob_Sit_FishingIdle</m_AnimName>
<m_blendInTime>0.3</m_blendInTime> <m_blendInTime>0.3</m_blendInTime>
<m_blendOutTime>0.3</m_blendOutTime> <m_blendOutTime>0.3</m_blendOutTime>
<m_speedScale>1.2</m_speedScale> <m_speedScale>1.2</m_speedScale>

View File

@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>Bob_NoLegsIdle</m_Name>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_SpeedScale>0.48</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Scalar>IdleSpeed</m_Scalar>
<m_Scalar2>IdleSpeed</m_Scalar2>
<m_2DBlends referenceID="1">
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>0.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="2">
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="3">
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>0.04</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlendTri>
<node1>1</node1>
<node2>2</node2>
<node3>3</node3>
</m_2DBlendTri>
<m_Transitions>
<m_Target>aim_default</m_Target>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_blendInTime>0.5</m_blendInTime>
<m_speedScale>1.5</m_speedScale>
</m_Transitions>
<m_Transitions>
<m_Target>defaultWalk</m_Target>
<m_blendInTime>0.3</m_blendInTime>
<m_blendOutTime>0.3</m_blendOutTime>
<m_Conditions>
<m_Name>isTurningAround</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
</m_Transitions>
<m_Transitions>
<m_Target>defaultRun</m_Target>
<m_AnimName>Zombie_Idle_FloorOnFront</m_AnimName>
<m_blendInTime>0.1</m_blendInTime>
<m_blendOutTime>0.1</m_blendOutTime>
<m_Conditions>
<m_Name>isTurningAround</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
</m_Transitions>
</animNode>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>NoLegs_Idle</m_Name>
<m_AnimName>Bob_Sit_FishingIdle</m_AnimName>
<m_DeferredBoneName>Translation_Data</m_DeferredBoneName>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_Looped>true</m_Looped>
<m_SpeedScale>0.8</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Transitions>
<m_Target>NoLegs_IdleSneak</m_Target>
<m_blendInTime>0.1</m_blendInTime>
</m_Transitions>
<m_Transitions>
<m_Target>NoLegs_Idle</m_Target>
<m_blendInTime>0.35</m_blendInTime>
<m_blendOutTime>0.35</m_blendOutTime>
</m_Transitions>
</animNode>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>NoLegs_IdleSneak</m_Name>
<m_AnimName>Bob_ScrambleFloorIdle</m_AnimName>
<m_Looped>true</m_Looped>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
<m_EarlyTransitionOut>true</m_EarlyTransitionOut>
<m_SpeedScale>0.8</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>sneaking</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
</animNode>

View File

@@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>defaultWalk</m_Name>
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_DeferredBoneName>Translation_Data</m_DeferredBoneName>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_SpeedScale>1.04</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Scalar>WalkInjury</m_Scalar>
<m_Scalar2>WalkSpeed</m_Scalar2>
<m_2DBlends referenceID="1">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>0.50</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="2">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>-0.50</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="3">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>1.00</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="4">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>-1.00</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="5">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>1.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlends referenceID="6">
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_XPos>0.00</m_XPos>
<m_YPos>0.00</m_YPos>
<m_SpeedScale>0.80</m_SpeedScale>
</m_2DBlends>
<m_2DBlendTri>
<node1>2</node1>
<node2>4</node2>
<node3>6</node3>
</m_2DBlendTri>
<m_2DBlendTri>
<node1>5</node1>
<node2>2</node2>
<node3>6</node3>
</m_2DBlendTri>
<m_2DBlendTri>
<node1>6</node1>
<node2>1</node2>
<node3>5</node3>
</m_2DBlendTri>
<m_2DBlendTri>
<node1>6</node1>
<node2>3</node2>
<node3>1</node3>
</m_2DBlendTri>
<m_Transitions>
<m_Target>Bob_NoLegsIdle</m_Target>
<m_blendInTime>0.3</m_blendInTime>
<m_speedScale>1</m_speedScale>
</m_Transitions>
<m_Transitions>
<m_Target>Bob_NoLegsIdle</m_Target>
<m_AnimName>Zombie_Crawl</m_AnimName>
<m_blendInTime>0.3</m_blendInTime>
<m_blendOutTime>0.3</m_blendOutTime>
<m_Conditions>
<m_Name>DeltaY</m_Name>
<m_Type>GTR</m_Type>
<m_FloatValue>-0.5</m_FloatValue>
</m_Conditions>
<m_Conditions>
<m_Name>isMoving</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
</m_Transitions>
<m_Transitions>
<m_Target>Bob_NoLegsIdle</m_Target>
<m_blendInTime>0.1</m_blendInTime>
</m_Transitions>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.15</m_TimePc>
<m_ParameterValue>walk</m_ParameterValue>
</m_Events>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.6</m_TimePc>
<m_ParameterValue>walk</m_ParameterValue>
</m_Events>
</animNode>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>NoLegs_Walk</m_Name>
<m_AnimName>Bob_Crawl</m_AnimName>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_Looped>true</m_Looped>
<m_SpeedScale>1.5</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.15</m_TimePc>
<m_ParameterValue>walk</m_ParameterValue>
</m_Events>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.6</m_TimePc>
<m_ParameterValue>walk</m_ParameterValue>
</m_Events>
</animNode>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>NoLegs_WalkSneak</m_Name>
<m_AnimName>Zombie_CrawlUnder</m_AnimName>
<m_DeferredBoneName>Translation_Data</m_DeferredBoneName>
<m_Looped>true</m_Looped>
<m_SpeedScale>1.5</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>sneaking</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>inTrees</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.15</m_TimePc>
<m_ParameterValue>sneak_walk</m_ParameterValue>
</m_Events>
<m_Events>
<m_EventName>Footstep</m_EventName>
<m_TimePc>0.6</m_TimePc>
<m_ParameterValue>sneak_walk</m_ParameterValue>
</m_Events>
</animNode>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>NoLegs_Turn</m_Name>
<m_DeferredBoneName>Bip01</m_DeferredBoneName>
<m_deferredBoneAxis>Y</m_deferredBoneAxis>
<m_useDeferedRotation>true</m_useDeferedRotation>
<m_SpeedScale>0.80</m_SpeedScale>
<m_BlendTime>0.10</m_BlendTime>
<m_BlendOutTime>0.20</m_BlendOutTime>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>isTurning</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_SubStateBoneWeights>
<boneName>Bip01_Pelvis</boneName>
<includeDescendants>false</includeDescendants>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_Spine</boneName>
<includeDescendants>false</includeDescendants>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_BackPack</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_DressFront</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_DressBack</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_L_Thigh</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_R_Thigh</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01</boneName>
<includeDescendants>false</includeDescendants>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Translation_Data</boneName>
<includeDescendants>false</includeDescendants>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_Prop1</boneName>
<weight>0.00</weight>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Bip01_Prop2</boneName>
<weight>0.00</weight>
</m_SubStateBoneWeights>
</animNode>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode x_extends="NoLegs_Turn.xml">
<m_Name>NoLegs_TurnIdle</m_Name>
<m_Looped>false</m_Looped>
<m_EarlyTransitionOut>true</m_EarlyTransitionOut>
<m_BlendOutTime>0.10</m_BlendOutTime>
<m_Conditions />
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>isMoving</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>Aim</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>false</m_BoolValue>
</m_Conditions>
<m_Transitions>
<m_Target>Idle</m_Target>
<m_blendInTime>0.1</m_blendInTime>
</m_Transitions>
<m_SubStateBoneWeights />
<m_SubStateBoneWeights>
<weight>0.25</weight>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<weight>0.20</weight>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
</animNode>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode x_extends="NoLegs_TurnIdle.xml">
<m_Name>NoLegs_TurnIdle180</m_Name>
<m_Conditions />
<m_Conditions />
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>isTurningAround</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_SubStateBoneWeights />
<m_SubStateBoneWeights>
<weight>0.00</weight>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
<m_SubStateBoneWeights />
</animNode>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode x_extends="NoLegs_TurnIdle180.xml">
<m_Name>NoLegs_turnIdle180L</m_Name>
<m_AnimName>Bob_Crawl</m_AnimName>
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>twist</m_Name>
<m_Type>LESS</m_Type>
<m_FloatValue>0</m_FloatValue>
</m_Conditions>
</animNode>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<animNode x_extends="NoLegs_TurnIdle180.xml">
<m_Name>NoLegs_TurnIdle180R</m_Name>
<m_AnimName>Bob_EmoteWaveBye</m_AnimName>
<m_Conditions />
<m_Conditions />
<m_Conditions />
<m_Conditions>
<m_Name>IsCrawling</m_Name>
<m_Type>BOOL</m_Type>
<m_BoolValue>true</m_BoolValue>
</m_Conditions>
<m_Conditions>
<m_Name>twist</m_Name>
<m_Type>GTR</m_Type>
<m_FloatValue>0</m_FloatValue>
</m_Conditions>
</animNode>

View File

@@ -5,7 +5,7 @@
local ServerCommands = {} local ServerCommands = {}
ServerCommands["ResponseCanAct"] = function(arg) ServerCommands.ResponseCanAct = function(arg)
print("TOC: ResponseCanAct") print("TOC: ResponseCanAct")
@@ -21,7 +21,7 @@ end
ServerCommands["CanCutLimb"] = function(arg) ServerCommands.CanCutLimb = function(arg)
local part_name = arg["toSend"] local part_name = arg["toSend"]
arg["To"] = arg["From"] arg["To"] = arg["From"]
@@ -31,21 +31,14 @@ ServerCommands["CanCutLimb"] = function(arg)
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
ServerCommands["CutLimb"] = function(arg) ServerCommands.CutLimb = function(arg)
local arg = arg["toSend"] local data = arg["toSend"]
--local surgeon_id = arg[5] TocCutLimb(data[1], data[2], data[3], data[4])
-- Disable the sound coming from the surgeon
--getPlayerByOnlineID(surgeon_id):getEmitter():stopSoundByName("Amputation_Sound")
TocCutLimb(arg[1], arg[2], arg[3], arg[4])
end end
ServerCommands["CanOperateLimb"] = function(arg) ServerCommands.CanOperateLimb = function(arg)
local part_name = arg["toSend"] local part_name = arg["toSend"]
arg["To"] = arg["From"] arg["To"] = arg["From"]
@@ -54,13 +47,14 @@ ServerCommands["CanOperateLimb"] = function(arg)
arg["toSend"] = { part_name, "Operate", CheckIfCanBeOperated(part_name) } arg["toSend"] = { part_name, "Operate", CheckIfCanBeOperated(part_name) }
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
ServerCommands["OperateLimb"] = function(arg) ServerCommands.OperateLimb = function(arg)
local arg = arg["toSend"]
TocOperateLimb(arg[1], arg[2], arg[3]) local data = arg["toSend"]
TocOperateLimb(data[1], data[2], data[3])
end end
ServerCommands["CanEquipProsthesis"] = function(arg) ServerCommands.CanEquipProsthesis = function(arg)
local part_name = arg["toSend"] local part_name = arg["toSend"]
--local item = arg["toSend"][2] -- TODO Add item prosth here --local item = arg["toSend"][2] -- TODO Add item prosth here
@@ -71,19 +65,18 @@ ServerCommands["CanEquipProsthesis"] = function(arg)
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
ServerCommands["EquipProsthesis"] = function(arg) ServerCommands.EquipProsthesis = function(arg)
-- part_name = arg[1] -- part_name = arg[1]
-- prosthesis = arg[2] -- prosthesis = arg[2]
local arg = arg["toSend"] local data = arg["toSend"]
TocEquipProsthesis(data[1], data[2])
TocEquipProsthesis(arg[1], arg[2])
end end
ServerCommands["CanUnequipProsthesis"] = function(arg) ServerCommands.CanUnequipProsthesis = function(arg)
local part_name = arg["toSend"] local part_name = arg["toSend"]
arg["To"] = arg["From"] arg["To"] = arg["From"]
arg["From"] = getPlayer():getOnlineID() arg["From"] = getPlayer():getOnlineID()
@@ -91,19 +84,18 @@ ServerCommands["CanUnequipProsthesis"] = function(arg)
arg["toSend"] = { part_name, "Unequip", CheckIfProsthesisCanBeUnequipped(part_name)} arg["toSend"] = { part_name, "Unequip", CheckIfProsthesisCanBeUnequipped(part_name)}
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
ServerCommands["UnequipProsthesis"] = function(arg) ServerCommands.UnequipProsthesis = function(arg)
-- part_name = arg[1] -- part_name = arg[1]
local arg = arg["toSend"] local data = arg["toSend"]
TheOnlyCure.TocUnequipProsthesis(data[1], data[2])
TheOnlyCure.TocUnequipProsthesis(arg[1], arg[2])
end end
ServerCommands["CanResetEverything"] = function(arg) ServerCommands.CanResetEverything = function(arg)
local part_name = "RightHand" --useless local part_name = "RightHand" --useless
arg["To"] = arg["From"] arg["To"] = arg["From"]
@@ -112,22 +104,20 @@ ServerCommands["CanResetEverything"] = function(arg)
arg["toSend"] = { part_name, "Cut", true } arg["toSend"] = { part_name, "Cut", true }
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
ServerCommands["ResetEverything"] = function(_) ServerCommands.ResetEverything = function(_)
TocResetEverything() TocResetEverything()
end end
-- Used when amputating the limb of another player -- Used when amputating the limb of another player
ServerCommands["AcceptDamageOtherPlayer"] = function(arg) ServerCommands.AcceptDamageOtherPlayer = function(arg)
local patient_id = arg[1]
local patient = getPlayerByOnlineID(arg[1]) local patient = getPlayerByOnlineID(arg[1])
local part_name = arg[2] local part_name = arg[2]
TocDamagePlayerDuringAmputation(patient, part_name) TocDamagePlayerDuringAmputation(patient, part_name)
end end
-- Used to propagate animation changes after amputating a foot -- Used to propagate animation changes after amputating a foot
ServerCommands["SetCrawlAnimation"] = function(args) ServerCommands.SetCrawlAnimation = function(args)
local player = getPlayerByOnlineID(args.id) local player = getPlayerByOnlineID(args.id)
local check = args.check local check = args.check
@@ -137,7 +127,7 @@ ServerCommands["SetCrawlAnimation"] = function(args)
end end
-- Used to propagate the stop of the sound of amputation -- Used to propagate the stop of the sound of amputation
ServerCommands["StopAmputationSound"] = function(args) ServerCommands.StopAmputationSound = function(args)
local player = getPlayerByOnlineID(args.surgeon_id) local player = getPlayerByOnlineID(args.surgeon_id)
player:getEmitter():stopSoundByName("Amputation_Sound") player:getEmitter():stopSoundByName("Amputation_Sound")

View File

@@ -249,6 +249,7 @@ local function TocUpdateEveryOneMinute()
-- Sends only Limbs since the other stuff is mostly static -- Sends only Limbs since the other stuff is mostly static
if toc_data ~= nil then if toc_data ~= nil then
-- FIXME Send little packets instead of the whole thing? -- FIXME Send little packets instead of the whole thing?
-- TODO we shouldn't run this if we're in SP I guess?
sendClientCommand(player, 'TOC', 'ChangePlayerState', { toc_data.Limbs } ) sendClientCommand(player, 'TOC', 'ChangePlayerState', { toc_data.Limbs } )
end end

View File

@@ -1,21 +1,18 @@
--- A rly big thx to Fenris_Wolf and Chuck to help me with that. Love you guy
---Server side local ClientCommands = {}
local TOC_Commands = {}
-- TODO rework this -- Main handler of base functions for TOC, not changed till now 'cause it works
TOC_Commands.SendServer = function(player, arg) ClientCommands.SendServer = function(player, arg)
local otherPlayer = getPlayerByOnlineID(arg["To"]) local otherPlayer = getPlayerByOnlineID(arg["To"])
sendServerCommand(otherPlayer, "TOC", arg["command"], arg) sendServerCommand(otherPlayer, "TOC", arg["command"], arg)
end end
-- Cutting Limbs
-- Cut Limb stuff ClientCommands.AskDamageOtherPlayer = function(_, arg)
TOC_Commands["AskDamageOtherPlayer"] = function(_, arg)
local patient = getPlayerByOnlineID(arg[1]) local patient = getPlayerByOnlineID(arg[1])
local patient_id = arg[1] local patient_id = arg[1]
@@ -25,9 +22,16 @@ TOC_Commands["AskDamageOtherPlayer"] = function(_, arg)
end end
ClientCommands.AskStopAmputationSound = function(_, args)
-------- ANIMATIONS print("TOC: We're in AskStopAmputationSound")
TOC_Commands["NotifyNewCrawlAnimation"] = function(player, args) sendServerCommand("TOC", "StopAmputationSound", {surgeon_id = args.surgeon_id})
end
-- Animations
ClientCommands.NotifyNewCrawlAnimation = function(player, args)
sendServerCommand("TOC", "SetCrawlAnimation", {id = args.id, check = args.check}) sendServerCommand("TOC", "SetCrawlAnimation", {id = args.id, check = args.check})
@@ -36,22 +40,15 @@ end
-- CHEATING STUFF -- Cheats
TOC_Commands["AskToResetEverything"] = function(_, arg) ClientCommands.AskToResetEverything = function(_, arg)
local clicked_player = getPlayerByOnlineID(arg[1]) local clicked_player = getPlayerByOnlineID(arg[1])
sendServerCommand(clicked_player, "TOC", "ResetEverything", {}) sendServerCommand(clicked_player, "TOC", "ResetEverything", {})
end end
TOC_Commands.AskStopAmputationSound = function(_, args) -- Global Mod Data data handler
ClientCommands.ChangePlayerState = function(playerObj, args)
print("TOC: We're in AskStopAmputationSound")
sendServerCommand("TOC", "StopAmputationSound", {surgeon_id = args.surgeon_id})
end
TOC_Commands.ChangePlayerState = function(playerObj, args)
ModData.get("TOC_PLAYER_DATA")[playerObj:getUsername()] = args ModData.get("TOC_PLAYER_DATA")[playerObj:getUsername()] = args
ModData.transmit("TOC_PLAYER_DATA") ModData.transmit("TOC_PLAYER_DATA")
end end
@@ -68,17 +65,12 @@ Events.OnInitGlobalModData.Add(TOC_OnInitGlobalModData)
------------------------------------------------------ ------------------------------------------------------
local function OnClientCommand(module, command, playerObj, args)
if module == 'TOC' and ClientCommands[command] then
TOC_Commands.OnClientCommand = function(module, command, playerObj, args) ClientCommands[command](playerObj, args)
print("TOC: Running ClientCommand " .. command)
if module == 'TOC' and TOC_Commands[command] then
TOC_Commands[command](playerObj, args)
end end
end end
Events.OnClientCommand.Add(OnClientCommand)
Events.OnClientCommand.Add(TOC_Commands.OnClientCommand)