require("Actors/AI/NativeHumanAI") -- or NativeCrabAI or NativeTurretAI function Create(self) self.AI = NativeHumanAI:Create(self) -- or NativeCrabAI or NativeTurretAI self.baseOffset = Vector(0,-3); self.mountMobile = CreateACrab("Fuchikoma Base"); self.mountMobile.Pos = self.Pos + self.baseOffset; self.mountMobile.Team = self.Team; self.mountMobile.AIMode = 0; MovableMan:AddParticle(self.mountMobile); self.crabMovement = false; end function Update(self) if MovableMan:IsParticle(self.mountMobile) then self.mountMobile.HFlipped = self.HFlipped; self.mountMobile.Health = self.Health; if self.HFlipped == false then self.negativeNum = 1; else self.negativeNum = -1; end self.mountMobile.AIMode = 0; self.Pos = self.mountMobile.Pos + Vector(self.baseOffset.X*self.negativeNum,self.baseOffset.Y):RadRotate(self.mountMobile.RotAngle); self.Vel = self.mountMobile.Vel; self.RotAngle = self.mountMobile.RotAngle; self.AngularVel = self.mountMobile.AngularVel; if self:GetController():IsState(Controller.MOVE_LEFT) then self.mountMobile:GetController():SetState(Controller.MOVE_LEFT,true); self.crabMovement = true; elseif self:GetController():IsState(Controller.MOVE_RIGHT) then self.crabMovement = true; self.mountMobile:GetController():SetState(Controller.MOVE_RIGHT,true); else self.mountMobile:GetController():SetState(Controller.MOVE_LEFT,false); self.mountMobile:GetController():SetState(Controller.MOVE_RIGHT,false); end if self:GetController():IsState(Controller.BODY_JUMP) then self.mountMobile:GetController():SetState(Controller.BODY_JUMP,true); else self.mountMobile:GetController():SetState(Controller.BODY_JUMP,false); end if self:GetController():IsState(Controller.BODY_JUMPSTART) then self.mountMobile:GetController():SetState(Controller.BODY_JUMPSTART,true); else self.mountMobile:GetController():SetState(Controller.BODY_JUMPSTART,false); end if not self.crabMovement then self.mountMobile.AngularVel = self.mountMobile.AngularVel*0.2; end self.crabMovement = false; end end function Destroy(self) if MovableMan:IsParticle(self.mountMobile) then ToActor(self.mountMobile).Health = 0; end end function UpdateAI(self) self.AI:Update(self) end