diff --git a/Base.rte/AI/DropShipAI.lua b/Base.rte/AI/DropShipAI.lua index 31c6e210c..d16171c91 100644 --- a/Base.rte/AI/DropShipAI.lua +++ b/Base.rte/AI/DropShipAI.lua @@ -10,3 +10,13 @@ end function UpdateAI(self) self.AI:Update(self) end + +function Update(self) + --Re-orient the craft at 180 degrees to help rotational AI + if self.RotAngle > math.pi then + self.RotAngle = self.RotAngle - (math.pi * 2); + end + if self.RotAngle < -math.pi then + self.RotAngle = self.RotAngle + (math.pi * 2); + end +end \ No newline at end of file diff --git a/Base.rte/AI/HumanAI.lua b/Base.rte/AI/HumanAI.lua index eb83845e8..82d82b3db 100644 --- a/Base.rte/AI/HumanAI.lua +++ b/Base.rte/AI/HumanAI.lua @@ -11,7 +11,6 @@ function Create(self) self.visibleInventory = true; end function Update(self) - self.controller = self:GetController(); if self.alternativeGib then @@ -21,7 +20,7 @@ function Update(self) HumanFunctions.DoAutomaticEquip(self); end if self.armSway then - HumanFunctions.DoArmSway(self, (self.Health / self.MaxHealth)); --Argument: shove strength + HumanFunctions.DoArmSway(self, (self.Health/self.MaxHealth)); --Argument: shove strength end if self.visibleInventory then HumanFunctions.DoVisibleInventory(self, false); --Argument: whether to show all items diff --git a/Base.rte/AI/HumanBehaviors.lua b/Base.rte/AI/HumanBehaviors.lua index a3779e1f5..022169313 100644 --- a/Base.rte/AI/HumanBehaviors.lua +++ b/Base.rte/AI/HumanBehaviors.lua @@ -9,18 +9,14 @@ function HumanBehaviors.GetTeamShootingSkill(team) end local aimSpeed, aimSkill - if skill < Activity.AVERAGESKILL then -- the AI shoot later and tracks the target slower - aimSpeed = -0.025 * skill + 3.3 -- affects the delay before the shooting starts [3.30 .. 1.55] - aimSkill = -0.011 * skill + 2.2 -- affects the precision of the shots [2.20 .. 1.43] - elseif skill >= Activity.UNFAIRSKILL then - aimSpeed = 0.05 - aimSkill = 0.05 + if skill >= Activity.UNFAIRSKILL then + aimSpeed = 0.04 + aimSkill = 0.04 else -- the AI shoot sooner and with slightly better precision - aimSpeed = 1/(0.55/(2.9-math.exp(skill*0.01))) -- [1.42 .. 0.38] - aimSkill = 1/(0.65/(3.0-math.exp(skill*0.01))) -- [1.36 .. 0.48] + aimSpeed = 1/(0.65/(2.9-math.exp(skill*0.01))) + aimSkill = 1/(0.75/(3.0-math.exp(skill*0.01))) end - return aimSpeed, aimSkill, skill end @@ -36,10 +32,10 @@ end -- spot targets by casting a ray in a random direction function HumanBehaviors.LookForTargets(AI, Owner, Skill) - local viewAngDeg = RangeRand(50, 120) * Owner.Perceptiveness * (0.5 + Skill / 200) + local viewAngDeg = RangeRand(50, 120) * Owner.Perceptiveness * (0.5 + Skill/200) if AI.deviceState == AHuman.AIMING then AI.Ctrl:SetState(Controller.AIM_SHARP, true) -- reinforce sharp aim controller state to enable SharpLength in LookForMOs - viewAngDeg = 15 * Owner.Perceptiveness + (Skill / 10) + viewAngDeg = 15 * Owner.Perceptiveness + (Skill/10) end local FoundMO = Owner:LookForMOs(viewAngDeg, rte.grassID, false) @@ -84,6 +80,8 @@ function HumanBehaviors.CheckEnemyLOS(AI, Owner, Skill) local LookTarget if Enemy.ClassName == "ADoor" then + -- TO-DO: use explosive weapons on doors? + local Door = ToADoor(Enemy).Door if Door and Door:IsAttached() then LookTarget = Door.Pos @@ -500,8 +498,7 @@ function HumanBehaviors.Sentry(AI, Owner, Abort) elseif AI.SentryFacing and Owner.HFlipped ~= AI.SentryFacing then Owner.HFlipped = AI.SentryFacing -- turn to the direction we have been order to guard break -- restart this behavior - elseif math.random() < Owner.Perceptiveness then - + elseif AI.Target == nil and math.random() < Owner.Perceptiveness then -- turn around occasionally if there is open space behind our back local backAreaRay = Vector(-math.random(FrameMan.PlayerScreenWidth/4, FrameMan.PlayerScreenWidth/2) * Owner.FlipFactor, 0):DegRotate(math.random(-25, 25) * Owner.Perceptiveness) if not SceneMan:CastStrengthRay(Owner.EyePos, backAreaRay, 10, Vector(), 10, rte.grassID, SceneMan.SceneWrapsX) then @@ -1682,13 +1679,12 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort) else nextLatMove = Actor.LAT_STILL end - if not (Owner.FGLeg and Owner.BGLeg) and not AI.jump then - Owner:GetController():SetState(Controller.BODY_CROUCH,true) -- crawl if no legs - end end elseif ((CurrDist.X < -5 and Owner.HFlipped) or (CurrDist.X > 5 and not Owner.HFlipped)) and math.abs(Owner.Vel.X) < 1 then -- no legs, jump forward AI.jump = true + elseif not AI.jump then + AI.proneState = AHuman.GOPRONE end if Waypoint.Type == "right" then @@ -1821,7 +1817,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort) local delta = SceneMan:ShortestDistance(Waypoint.Pos, FallPos, false).Magnitude - Facings[1].range if delta < 1 then AI.jump = false - elseif AI.flying or delta > 15 then + elseif AI.flying or delta > 25 then AI.jump = true nextAimAngle = Owner:GetAimAngle(false) * 0.5 + Facings[1].aim * 0.5 -- adjust jetpack nozzle direction nextLatMove = Actor.LAT_STILL @@ -2146,15 +2142,14 @@ function HumanBehaviors.GetProjectileData(Owner) -- find muzzle velocity PrjDat.vel = Weapon:GetAIFireVel() - -- half of the theoretical upper limit for the total amount of material strength this weapon can destroy in 250ms - PrjDat.pen = Weapon:GetAIPenetration() * math.max((Weapon.RateOfFire / 240), 1) PrjDat.g = SceneMan.GlobalAcc.Y * 0.67 * Weapon:GetBulletAccScalar() -- underestimate gravity PrjDat.vsq = PrjDat.vel^2 -- muzzle velocity squared PrjDat.vqu = PrjDat.vsq^2 -- muzzle velocity quad PrjDat.drg = 1 - Projectile.AirResistance * TimerMan.DeltaTimeSecs -- AirResistance is stored as the ini-value times 60 PrjDat.thr = math.min(Projectile.AirThreshold, PrjDat.vel) + PrjDat.pen = (Projectile.Mass * Projectile.Sharpness * PrjDat.vel) * PrjDat.drg -- estimate theoretical max range with ... local lifeTime = Weapon:GetAIBulletLifeTime() @@ -2162,8 +2157,9 @@ function HumanBehaviors.GetProjectileData(Owner) PrjDat.rng = math.huge elseif PrjDat.drg < 1 then -- AirResistance PrjDat.rng = 0 - local threshold = PrjDat.thr * GetPPM() * TimerMan.DeltaTimeSecs -- AirThreshold in pixels/frame - local vel = PrjDat.vel * GetPPM() * TimerMan.DeltaTimeSecs -- muzzle velocity in pixels/frame + local threshold = PrjDat.thr * rte.PxTravelledPerFrame -- AirThreshold in pixels/frame + local vel = PrjDat.vel * rte.PxTravelledPerFrame -- muzzle velocity in pixels/frame + for _ = 0, math.ceil(lifeTime/TimerMan.DeltaTimeMS) do PrjDat.rng = PrjDat.rng + vel if vel > threshold then @@ -2171,7 +2167,7 @@ function HumanBehaviors.GetProjectileData(Owner) end end else -- no AirResistance - PrjDat.rng = PrjDat.vel * GetPPM() * TimerMan.DeltaTimeSecs * (lifeTime / TimerMan.DeltaTimeMS) + PrjDat.rng = PrjDat.vel * rte.PxTravelledPerFrame * (lifeTime / TimerMan.DeltaTimeMS) end -- Artificially decrease reported range to make sure AI @@ -2633,9 +2629,9 @@ function HumanBehaviors.ThrowTarget(AI, Owner, Abort) local scan = 0 local miss = 0 -- stop scanning after a few missed attempts local AimPoint, Dist, MO, ID, rootID, LOS, aim - + AI.TargetLostTimer:SetSimTimeLimitMS(1500) - + while true do if not MovableMan:ValidMO(AI.Target) then break @@ -2747,7 +2743,7 @@ function HumanBehaviors.ThrowTarget(AI, Owner, Abort) aim = HumanBehaviors.GetGrenadeAngle(AimPoint, Vector(), Grenade.MuzzlePos, Grenade.MaxThrowVel) if aim then ThrowTimer:Reset() - aimTime = RangeRand(1000, 1200) + aimTime = RangeRand(900, 1100) local maxAim = aim -- try again with an average throw vel @@ -2829,24 +2825,22 @@ function HumanBehaviors.AttackTarget(AI, Owner, Abort) local meleeDist = 0 local startPos = Vector(Owner.EyePos.X, Owner.EyePos.Y) - if Owner.EquippedItem then - if Owner.EquippedItem:HasObjectInGroup("Tools - Diggers") or Owner.EquippedItem:HasObjectInGroup("Weapons - Melee") then - meleeDist = Owner.Radius + 25 - startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y) - end + if Owner:EquipDeviceInGroup("Tools - Diggers", true) or Owner:EquipDeviceInGroup("Weapons - Melee", true) then + meleeDist = Owner.Radius + 25 + startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y) elseif Owner.armSway then - if Owner.FGArm then - meleeDist = Owner.Radius + Owner.FGArm.Radius - startPos = Owner.FGArm.Pos - elseif Owner.BGArm then - meleeDist = Owner.Radius + Owner.BGArm.Radius - startPos = Owner.BGArm.Pos + local arm = Owner.FGArm or Owner.BGArm + if arm then + meleeDist = arm.Radius + arm.Radius + startPos = arm.Pos end end if meleeDist > 0 then - local dist = SceneMan:ShortestDistance(startPos, AI.Target.Pos, false) + local attackPos = (AI.Target.ClassName == "ADoor" and ToADoor(AI.Target).Door and ToADoor(AI.Target).Door:IsAttached()) and ToADoor(AI.Target).Door.Pos or AI.Target.Pos + local dist = SceneMan:ShortestDistance(startPos, attackPos, false) if dist.Magnitude < meleeDist then - AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.EyePos, AI.Target.Pos, false).Normalized + AI.lateralMoveState = Actor.LAT_STILL + AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.EyePos, attackPos, false).Normalized AI.fire = true else AI.fire = false diff --git a/Base.rte/AI/HumanFunctions.lua b/Base.rte/AI/HumanFunctions.lua index 8339e4b11..1369fa6a4 100644 --- a/Base.rte/AI/HumanFunctions.lua +++ b/Base.rte/AI/HumanFunctions.lua @@ -2,26 +2,27 @@ HumanFunctions = {}; function HumanFunctions.DoAlternativeGib(actor) --Detach limbs instead of regular gibbing - if not actor.detachLimit then - actor.detachLimit = actor.GibWoundLimit; - actor.GibWoundLimit = actor.GibWoundLimit * 1.5; - end - if actor.WoundCount > actor.detachLimit then - actor.detachLimit = actor.WoundCount + 1; - local parts = {actor.BGArm, actor.BGLeg, actor.FGArm, actor.FGLeg, actor.Head}; --Piority order - local mostWounds = -1; - local detachLimb; - --Pick the limb with most wounds and detach it - for i = 1, #parts do - local limb = parts[i]; - if limb and limb.WoundCount > mostWounds then - detachLimb = limb; - mostWounds = limb.WoundCount; + if actor.detachLimit then + if actor.WoundCount > actor.detachLimit then + actor.detachLimit = actor.WoundCount + 1; + local parts = {actor.BGArm, actor.BGLeg, actor.FGArm, actor.FGLeg, actor.Head}; --Priority order + local mostWounds = -1; + local detachLimb; + --Pick the limb with most wounds and detach it + for i = 1, #parts do + local limb = parts[i]; + if limb and limb.WoundCount > mostWounds then + detachLimb = limb; + mostWounds = limb.WoundCount; + end + end + if detachLimb then + detachLimb.JointStrength = -1; end end - if detachLimb then - detachLimb.JointStrength = -1; - end + elseif actor.GibWoundLimit > 0 then + actor.detachLimit = actor.GibWoundLimit; + actor.GibWoundLimit = actor.GibWoundLimit * 1.5; end end @@ -39,20 +40,15 @@ function HumanFunctions.DoArmSway(actor, pushStrength) actor.lastAngle = aimAngle; actor.lastHandPos = {actor.Pos, actor.Pos}; end - if actor.controller:IsMouseControlled() then - --Flail around if moving mouse too fast - local mouseVec = Vector(actor.controller.MouseMovement.X, actor.controller.MouseMovement.Y):SetMagnitude(math.sqrt(actor.controller.MouseMovement.Magnitude)); - local ang = actor.lastAngle - aimAngle; - - actor.AngularVel = actor.AngularVel - (2 * ang * actor.FlipFactor + mouseVec.Y * actor.FlipFactor /10) /math.sqrt(math.abs(actor.AngularVel) + 1); - - actor.lastAngle = aimAngle; - end + --Flail around if aiming around too fast + local angleMovement = actor.lastAngle - aimAngle; + actor.AngularVel = actor.AngularVel - (2 * angleMovement * actor.FlipFactor)/(math.abs(actor.AngularVel)/10 + 1); + actor.lastAngle = aimAngle; --Shove when unarmed if actor.controller:IsState(Controller.WEAPON_FIRE) and (actor.FGArm or actor.BGArm) and not (actor.EquippedItem or actor.EquippedBGItem) and actor.Status == Actor.STABLE then - actor.AngularVel = actor.AngularVel /(actor.shoved and 1.3 or 3) + (aimAngle - actor.RotAngle * actor.FlipFactor - 1.57) * (actor.shoved and 0.3 or 3) * actor.FlipFactor /(1 + math.abs(actor.RotAngle)); + actor.AngularVel = actor.AngularVel/(actor.shoved and 1.3 or 3) + (aimAngle - actor.RotAngle * actor.FlipFactor - 1.57) * (actor.shoved and 0.3 or 3) * actor.FlipFactor/(1 + math.abs(actor.RotAngle)); if not actor.shoved then - actor.Vel = actor.Vel + Vector(2 /(1 + actor.Vel.Magnitude), 0):RadRotate(actor:GetAimAngle(true)) * math.abs(math.cos(actor:GetAimAngle(true))); + actor.Vel = actor.Vel + Vector(2/(1 + actor.Vel.Magnitude), 0):RadRotate(actor:GetAimAngle(true)) * math.abs(math.cos(actor:GetAimAngle(true))); actor.shoved = true; end else @@ -78,31 +74,31 @@ function HumanFunctions.DoArmSway(actor, pushStrength) if actor.controller:IsState(Controller.AIM_SHARP) then arm.IdleOffset = Vector(0, 1):RadRotate(aimAngle); else - arm.IdleOffset = Vector(0, (armLength + arm.SpriteOffset.X) * 1.1):RadRotate(rotAng * actor.FlipFactor + 1.5 + (i /5)); + arm.IdleOffset = Vector(0, (armLength + arm.SpriteOffset.X) * 1.1):RadRotate(rotAng * actor.FlipFactor + 1.5 + (i/5)); end if actor.shoved or (actor.EquippedItem and IsTDExplosive(actor.EquippedItem) and actor.controller:IsState(Controller.WEAPON_FIRE)) then arm.IdleOffset = Vector(armLength + (pushStrength * armLength), 0):RadRotate(aimAngle); local handVector = SceneMan:ShortestDistance(actor.lastHandPos[i], arm.HandPos, SceneMan.SceneWrapsX); --Diminish hand relocation vector to potentially prevent post-superhuman pushing powers - handVector:SetMagnitude(handVector.Magnitude / (1 + handVector.Magnitude / 100)); + handVector:SetMagnitude(handVector.Magnitude/(1 + handVector.Magnitude/100)); --Emphasize the first frames that signify contracted arm = highest potential energy - local dots = math.sqrt(arm.Radius) / (1 + arm.Frame /arm.FrameCount); + local dots = math.sqrt(arm.Radius)/(1 + arm.Frame/arm.FrameCount); local armStrength = (arm.Mass + arm.Material.StructuralIntegrity) * pushStrength; for i = 1, dots do local part = CreateMOPixel("Smack Particle Light"); - part.Pos = arm.HandPos - Vector(handVector.X/2, handVector.Y /2); + part.Pos = arm.HandPos - Vector(handVector.X/2, handVector.Y/2); part.Vel = Vector(handVector.X, handVector.Y):RadRotate(RangeRand(-0.1, 0.1)) + Vector(0, -0.5); part.Mass = armStrength; part.Sharpness = math.random() * 0.1; part.Team = actor.Team; part.IgnoresTeamHits = true; MovableMan:AddParticle(part); end --Apply some additional forces if the travel vector of the moving hand is half an arms length - if handVector.Magnitude > (armLength /2) then + if handVector.Magnitude > (armLength/2) then local moCheck = SceneMan:GetMOIDPixel(arm.HandPos.X, arm.HandPos.Y) if moCheck ~= rte.NoMOID then local mo = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck).RootID); - if mo and mo.Team ~= actor.Team and IsActor(mo) and actor.Mass > (mo.Mass / 2) then - mo:AddForce(handVector * (actor.Mass / 2), Vector()); + if mo and mo.Team ~= actor.Team and IsActor(mo) and actor.Mass > (mo.Mass/2) then + mo:AddForce(handVector * (actor.Mass/2), Vector()); ToActor(mo).Status = Actor.UNSTABLE; end end @@ -120,7 +116,6 @@ function HumanFunctions.DoVisibleInventory(actor, showAll) for i = 1, actor.InventorySize do local item = actor:Inventory(); if item then - local fixNum = actor.HFlipped and -1 or 0; --Fix offsets slightly when facing left if item.ClassName == "TDExplosive" then thrownCount = thrownCount + 1; elseif item.ClassName == "HDFirearm" or item.ClassName == "HeldDevice" then @@ -131,7 +126,7 @@ function HumanFunctions.DoVisibleInventory(actor, showAll) local isFirearm = item.ClassName == "HeldDevice" and 0 or 1; local actorSize, itemSize = math.sqrt(actor.Radius), math.sqrt(item.Radius + math.abs(item.Mass)); - fixNum = fixNum + item.Radius * 0.2 + math.sqrt(heldCount); + local fixNum = item.Radius * 0.2 + math.sqrt(heldCount); --Bigger actors carry weapons higher up, smaller weapons are carried lower down local drawPos = actor.Pos + Vector((-actorSize - fixNum) * actor.FlipFactor, -actorSize - itemSize + 1 + isFirearm * 3):RadRotate(actor.RotAngle); @@ -141,11 +136,13 @@ function HumanFunctions.DoVisibleInventory(actor, showAll) local tallAng = ToMOSprite(item):GetSpriteWidth() > ToMOSprite(item):GetSpriteHeight() and 1.57 or 0; local tilt = 0.3; - local rotAng = actor.RotAngle + tallAng + (heldCount * tilt - itemCount * tilt + isFirearm /itemSize) /itemCount * actor.FlipFactor; + local rotAng = actor.RotAngle + tallAng + (heldCount * tilt - itemCount * tilt + isFirearm/itemSize)/itemCount * actor.FlipFactor; for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do - if not SceneMan:IsUnseen(drawPos.X, drawPos.Y, ActivityMan:GetActivity():GetTeamOfPlayer(player)) then - PrimitiveMan:DrawBitmapPrimitive(ActivityMan:GetActivity():ScreenOfPlayer(player), drawPos, item, rotAng, 0); + + local screen = ActivityMan:GetActivity():ScreenOfPlayer(player); + if screen ~= -1 and not SceneMan:IsUnseen(drawPos.X, drawPos.Y, ActivityMan:GetActivity():GetTeamOfPlayer(player)) then + PrimitiveMan:DrawBitmapPrimitive(screen, drawPos, item, rotAng, 0); end end end diff --git a/Base.rte/AI/NativeHumanAI.lua b/Base.rte/AI/NativeHumanAI.lua index e7308fc24..ae7673149 100644 --- a/Base.rte/AI/NativeHumanAI.lua +++ b/Base.rte/AI/NativeHumanAI.lua @@ -218,25 +218,28 @@ function NativeHumanAI:Update(Owner) end - -- check if the legs reach the ground + -- check if the feet reach the ground if self.AirTimer:IsPastSimMS(120) then self.AirTimer:Reset() - local Origin - if Owner.FGLeg then - Origin = Vector(Owner.FGLeg.Pos.X, Owner.FGLeg.Pos.Y) - elseif Owner.BGLeg then - Origin = Vector(Owner.BGLeg.Pos.X, Owner.BGLeg.Pos.Y) - else - Origin = Vector(Owner.Pos.X, Owner.Pos.Y) + local Origin = {} + if Owner.FGFoot then + table.insert(Origin, Vector(Owner.FGFoot.Pos.X, Owner.FGFoot.Pos.Y) + Vector(0, 4)) end - - if -1 < SceneMan:CastObstacleRay(Origin, Vector(RangeRand(-8, 8), Owner.Height * 0.17), Vector(), Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 3) then - self.groundContact = 3 - else - self.groundContact = self.groundContact - 1 + if Owner.BGFoot then + table.insert(Origin, Vector(Owner.BGFoot.Pos.X, Owner.BGFoot.Pos.Y) + Vector(0, 4)) + end + if #Origin == 0 then + table.insert(Origin, Vector(Owner.Pos.X, Owner.Pos.Y) + Vector(0, 4 + ToMOSprite(Owner):GetSpriteHeight() + Owner.SpriteOffset.Y)) + end + for i = 1, #Origin do + if SceneMan:GetTerrMatter(Origin[i].X, Origin[i].Y) ~= rte.airID then + self.groundContact = 3 + break + else + self.groundContact = self.groundContact - 1 + end end - self.flying = false if self.groundContact < 0 then self.flying = true @@ -275,7 +278,8 @@ function NativeHumanAI:Update(Owner) FoundMO = ToACRocket(FoundMO) elseif FoundMO.ClassName == "ACDropShip" then FoundMO = ToACDropShip(FoundMO) - elseif FoundMO.ClassName == "ADoor" then + elseif FoundMO.ClassName == "ADoor" and ToADoor(FoundMO).Door and ToADoor(FoundMO).Door:IsAttached() + and (Owner:EquipNamedDevice("Heavy Digger", true) or (Owner.FirearmIsReady and HumanBehaviors.GetProjectileData(Owner).pen * 0.9 > ToADoor(FoundMO).Door.Material.StructuralIntegrity)) then FoundMO = ToADoor(FoundMO) elseif FoundMO.ClassName == "Actor" then FoundMO = ToActor(FoundMO) @@ -409,9 +413,6 @@ function NativeHumanAI:Update(Owner) end if Leader.AIMode == Actor.AIMODE_GOTO then Owner.leaderWaypoint = Leader:GetLastAIWaypoint() - elseif Leader.AIMode ~= Actor.AIMODE_SENTRY then - Owner.AIMode = Leader.AIMode - Owner:ClearMovePath() end end end @@ -484,6 +485,8 @@ function NativeHumanAI:Update(Owner) self.jump = false self.lateralMoveState = Actor.LAT_STILL end + else + self.jump = false end -- run the selected behavior and delete it if it returns true @@ -540,11 +543,10 @@ function NativeHumanAI:Update(Owner) end elseif not self.Target and not self.UnseenTarget then -- use medikit if not engaging enemy - if Owner.Health < (Owner.MaxHealth / 2) then + if Owner.Health < (Owner.MaxHealth/2) then if Owner:HasObject("Medikit") then - Owner:EquipNamedDevice("Medikit", true) - self.useMedikit = true + self.useMedikit = Owner:EquipNamedDevice("Medikit", true) else self.useMedikit = false if self.scatter ~= true and Owner.AIMode == Actor.AIMODE_SENTRY then @@ -714,8 +716,18 @@ end function NativeHumanAI:CreateAttackBehavior(Owner) self.ReloadTimer:Reset() self.TargetLostTimer:Reset() + + local dist = SceneMan:ShortestDistance(Owner.Pos, self.Target.Pos, false).Magnitude - if Owner:EquipFirearm(true) then + if self.Target and IsADoor(self.Target) and Owner:EquipNamedDevice("Heavy Digger", true) then + self.NextBehavior = coroutine.create(HumanBehaviors.AttackTarget) + self.NextBehaviorName = "AttackTarget" + -- favor grenades as the initiator to a sneak attack + elseif Owner.AIMode ~= Actor.AIMODE_SQUAD and Owner.AIMode ~= Actor.AIMODE_SENTRY and self.Target.HFlipped == Owner.HFlipped and Owner:EquipDeviceInGroup("Bombs - Grenades", true) + and dist > 100 and dist < ToThrownDevice(Owner.EquippedItem).MaxThrowVel * 20 and (self.Target.Pos.Y + 20) > Owner.Pos.Y then + self.NextBehavior = coroutine.create(HumanBehaviors.ThrowTarget) + self.NextBehaviorName = "ThrowTarget" + elseif Owner:EquipFirearm(true) then if Owner.EquippedItem:HasObjectInGroup("Weapons - Melee") then self.NextBehavior = coroutine.create(HumanBehaviors.AttackTarget) self.NextBehaviorName = "AttackTarget" @@ -723,12 +735,10 @@ function NativeHumanAI:CreateAttackBehavior(Owner) self.NextBehavior = coroutine.create(HumanBehaviors.ShootTarget) self.NextBehaviorName = "ShootTarget" end - elseif Owner.AIMode ~= Actor.AIMODE_SQUAD and Owner:EquipThrowable(true) then + elseif Owner.AIMode ~= Actor.AIMODE_SQUAD and Owner:EquipThrowable(true) and dist < (ToThrownDevice(Owner.EquippedItem).MaxThrowVel * 10) then self.NextBehavior = coroutine.create(HumanBehaviors.ThrowTarget) self.NextBehaviorName = "ThrowTarget" - elseif Owner.AIMode ~= Actor.AIMODE_SQUAD and Owner:EquipDiggingTool(true) and - SceneMan:ShortestDistance(Owner.Pos, self.Target.Pos, false).Magnitude < 150 - then + elseif Owner.AIMode ~= Actor.AIMODE_SQUAD and Owner:EquipDiggingTool(true) and dist < 150 then self.NextBehavior = coroutine.create(HumanBehaviors.AttackTarget) self.NextBehaviorName = "AttackTarget" else -- unarmed or far away diff --git a/Base.rte/Activities/BrainVsBrain.lua b/Base.rte/Activities/BrainVsBrain.lua index dbc16e2f4..4f6ad3707 100644 --- a/Base.rte/Activities/BrainVsBrain.lua +++ b/Base.rte/Activities/BrainVsBrain.lua @@ -85,9 +85,9 @@ function BrainvsBrain:StartActivity() local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player)) -- Spawn a brain if we can't find an unassigned brain in the scene to give each player if not foundBrain then - local Brain = CreateAHuman("Brain Robot", "Base.rte") + local Brain = RandomAHuman("Brains", self:GetTeamTech(self:GetTeamOfPlayer(player))) if Brain then - local Weapon = CreateHDFirearm("SMG", "Base.rte") + local Weapon = RandomHDFirearm("Weapons - Primary", self:GetTeamTech(self:GetTeamOfPlayer(player))) if Weapon then Brain:AddInventoryItem(Weapon) end @@ -548,7 +548,7 @@ function BrainvsBrain:CreateHeavyDrop(xPosLZ) Craft.Pos = Vector(xPosLZ, -30) -- Set the spawn point of the craft for i = 1, Craft.MaxPassengers do - if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.TechName[self.CPUTeam])) + self.Difficulty / 800 then + if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.TechName[self.CPUTeam])) then Passenger = self:CreateCrab(self.CPUTeam) elseif RangeRand(0, 105) < self.Difficulty then Passenger = self:CreateHeavyInfantry(self.CPUTeam) diff --git a/Base.rte/Activities/BunkerBreach.lua b/Base.rte/Activities/BunkerBreach.lua index 20184bfe5..5e75341b4 100644 --- a/Base.rte/Activities/BunkerBreach.lua +++ b/Base.rte/Activities/BunkerBreach.lua @@ -50,7 +50,7 @@ function BunkerBreach:StartActivity() -- Add player brains for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do if self:PlayerActive(player) and self:PlayerHuman(player) then - local Brain = CreateAHuman("Brain Robot", "Base.rte") + local Brain = RandomAHuman("Brains", self:GetTeamTech(self:GetTeamOfPlayer(player))) if Brain then local Weapon = RandomHDFirearm("Weapons - Light", self:GetTeamTech(self:GetTeamOfPlayer(player))) if Weapon then @@ -488,7 +488,7 @@ function BunkerBreach:CreateHeavyDrop(xPosLZ) Craft.Pos = Vector(xPosLZ, -30) -- Set the spawn point of the craft for i = 1, Craft.MaxPassengers do - if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) + self.Difficulty / 800 then + if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTechName)) then Passenger = self:CreateCrab() elseif RangeRand(0, 105) < self.Difficulty then Passenger = self:CreateHeavyInfantry() @@ -841,7 +841,7 @@ function BunkerBreach:CreateBrainBot(mode) Act:AddInventoryItem(RandomHDFirearm("Weapons - Light", self.CPUTechName)) Act:AddInventoryItem(CreateHDFirearm("Medium Digger", "Base.rte")) - if PosRand() < 0.5 then + if math.random() < 0.5 then Act:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)) end diff --git a/Base.rte/Activities/Harvester.lua b/Base.rte/Activities/Harvester.lua index 3d9b8f1ac..51faf31c4 100644 --- a/Base.rte/Activities/Harvester.lua +++ b/Base.rte/Activities/Harvester.lua @@ -173,7 +173,7 @@ function Harvester:UpdateActivity() if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then local ship, actorsInCargo - if PosRand() < 0.5 then + if math.random() < 0.5 then -- Set up the ship to deliver this stuff ship = RandomACDropShip("Any", self.CPUTechName); -- If we can't afford this dropship, then try a rocket instead @@ -202,7 +202,7 @@ function Harvester:UpdateActivity() if IsAHuman(passenger) then passenger:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); - if PosRand() < 0.5 then + if math.random() < 0.5 then passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/Base.rte/Activities/KeepieUppie.lua b/Base.rte/Activities/KeepieUppie.lua index 4d58ecd33..255e987ae 100644 --- a/Base.rte/Activities/KeepieUppie.lua +++ b/Base.rte/Activities/KeepieUppie.lua @@ -135,7 +135,7 @@ function KeepieUppie:UpdateActivity() if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then local ship, actorsInCargo - if PosRand() < 0.5 then + if math.random() < 0.5 then -- Set up the ship to deliver this stuff ship = RandomACDropShip("Any", self.CPUTechName); actorsInCargo = ship.MaxPassengers @@ -159,7 +159,7 @@ function KeepieUppie:UpdateActivity() if IsAHuman(passenger) then passenger:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); - if PosRand() < 0.5 then + if math.random() < 0.5 then passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/Base.rte/Activities/Massacre.lua b/Base.rte/Activities/Massacre.lua index 8d718a75a..fd7246a3f 100644 --- a/Base.rte/Activities/Massacre.lua +++ b/Base.rte/Activities/Massacre.lua @@ -169,7 +169,7 @@ function Massacre:UpdateActivity() if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then local ship, actorsInCargo - if PosRand() < 0.5 then + if math.random() < 0.5 then -- Set up the ship to deliver this stuff ship = RandomACDropShip("Any", self.CPUTechName); -- If we can't afford this dropship, then try a rocket instead @@ -198,7 +198,7 @@ function Massacre:UpdateActivity() if IsAHuman(passenger) then passenger:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); - if PosRand() < 0.5 then + if math.random() < 0.5 then passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/Base.rte/Activities/OneManArmy.lua b/Base.rte/Activities/OneManArmy.lua index d1bab9705..16ea85b39 100644 --- a/Base.rte/Activities/OneManArmy.lua +++ b/Base.rte/Activities/OneManArmy.lua @@ -55,7 +55,14 @@ function OneManArmy:StartActivity() secondaryGroup = "Weapons - Secondary"; actorGroup = "Actors - Light"; end - + -- Destroy all doors for this Activity + MovableMan:OpenAllDoors(true, -1); + for actor in MovableMan.AddedActors do + if actor.ClassName == "ADoor" then + actor.ToSettle = true; + actor:GibThis(); + end + end -- Check if we already have a brain assigned for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do if self:PlayerActive(player) and self:PlayerHuman(player) then @@ -111,9 +118,9 @@ function OneManArmy:StartActivity() else -- If no tech selected, use default items local weapons = {defaultPrimary, defaultSecondary}; for i = 1, #weapons do - local item = weapons[i]; + local item = CreateHDFirearm(weapons[i]); if item then - item.GibWoundLimit = item.GibWoundLimit * self.multiplier; + item.GibWoundLimit = item.GibWoundLimit and item.GibWoundLimit * self.multiplier or item.GibWoundLimit; item.JointStrength = item.JointStrength * self.multiplier; foundBrain:AddInventoryItem(CreateHDFirearm(weapons[i])); end @@ -262,7 +269,7 @@ function OneManArmy:UpdateActivity() if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then local ship, actorsInCargo - if PosRand() < 0.5 then + if math.random() < 0.5 then -- Set up the ship to deliver this stuff ship = RandomACDropShip("Any", self.CPUTechName); -- If we can't afford this dropship, then try a rocket instead @@ -299,7 +306,7 @@ function OneManArmy:UpdateActivity() if IsAHuman(passenger) then passenger:AddInventoryItem(RandomHDFirearm("Weapons - Light", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); - if PosRand() < 0.5 then + if math.random() < 0.5 then passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/Base.rte/Activities/OneManArmyDiggers.lua b/Base.rte/Activities/OneManArmyDiggers.lua index 9575bc219..c8dbe33c1 100644 --- a/Base.rte/Activities/OneManArmyDiggers.lua +++ b/Base.rte/Activities/OneManArmyDiggers.lua @@ -57,7 +57,14 @@ function OneManArmy:StartActivity() primaryGroup = "Weapons - Secondary"; secondaryGroup = "Tools"; end - + -- Destroy all doors for this Activity + MovableMan:OpenAllDoors(true, -1); + for actor in MovableMan.AddedActors do + if actor.ClassName == "ADoor" then + actor.ToSettle = true; + actor:GibThis(); + end + end -- Check if we already have a brain assigned for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do if self:PlayerActive(player) and self:PlayerHuman(player) then @@ -226,21 +233,10 @@ function OneManArmy:UpdateActivity() --Spawn the AI. if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then - local ship, actorsInCargo - - if PosRand() < 0.5 then - -- Set up the ship to deliver this stuff - ship = RandomACDropShip("Any", self.CPUTechName); - -- If we can't afford this dropship, then try a rocket instead - if ship:GetTotalValue(0,3) > self:GetTeamFunds(self.CPUTeam) then - DeleteEntity(ship); - ship = RandomACRocket("Any", self.CPUTechName); - end - actorsInCargo = ship.MaxPassengers - else - ship = RandomACRocket("Any", self.CPUTechName); - actorsInCargo = math.min(ship.MaxPassengers, 2) - end + + -- Set up the ship to deliver this stuff + local ship = RandomACRocket("Any", self.CPUTechName); + local actorsInCargo = math.min(ship.MaxPassengers, 2) ship.Team = self.CPUTeam; diff --git a/Base.rte/Activities/Siege.lua b/Base.rte/Activities/Siege.lua index 85aedfd06..3c758daf9 100644 --- a/Base.rte/Activities/Siege.lua +++ b/Base.rte/Activities/Siege.lua @@ -481,7 +481,7 @@ function Siege:CreateHeavyDrop(xPosLZ, techName) Craft.Pos = Vector(xPosLZ, -30) -- Set the spawn point of the craft for i = 1, Craft.MaxPassengers do - if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(techName)) + self.Difficulty / 800 then + if math.random() < self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(techName)) then Passenger = self:CreateCrab(Actor.AIMODE_GOTO, techName) elseif RangeRand(0, 105) < self.Difficulty then Passenger = self:CreateHeavyInfantry(Actor.AIMODE_GOTO,techName) @@ -1019,7 +1019,7 @@ function Siege:CreateBrainBot(mode, team, techName) Act:AddInventoryItem(RandomHDFirearm("Weapons - Light", techName)) Act:AddInventoryItem(CreateHDFirearm("Medium Digger", "Base.rte")) - if PosRand() < 0.5 then + if math.random() < 0.5 then Act:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", techName)) end diff --git a/Base.rte/Activities/SkirmishDefense.lua b/Base.rte/Activities/SkirmishDefense.lua index 9944d7a05..2941ca99f 100644 --- a/Base.rte/Activities/SkirmishDefense.lua +++ b/Base.rte/Activities/SkirmishDefense.lua @@ -601,7 +601,7 @@ function SkirmishDefense:CreateHeavyDrop(xPosLZ, Destination, Team) for _ = 1, actorsInCargo do local Passenger - if math.random() < self:GetCrabToHumanSpawnRatio(self.AI[Team].TechID) + self.Difficulty / 800 then + if math.random() < self:GetCrabToHumanSpawnRatio(self.AI[Team].TechID) then Passenger = self:CreateCrab(Team) elseif RangeRand(0, 105) < self.Difficulty then Passenger = self:CreateHeavyInfantry(Team) diff --git a/Base.rte/Activities/Survival.lua b/Base.rte/Activities/Survival.lua index 25edb0d32..ddea01590 100644 --- a/Base.rte/Activities/Survival.lua +++ b/Base.rte/Activities/Survival.lua @@ -177,7 +177,7 @@ function Survival:UpdateActivity() if self.CPUTeam ~= Activity.NOTEAM and self.ESpawnTimer:LeftTillSimMS(self.TimeLeft) <= 0 and MovableMan:GetTeamMOIDCount(self.CPUTeam) <= rte.AIMOIDMax * 3 / self:GetActiveCPUTeamCount() then local ship, actorsInCargo - if PosRand() < 0.5 then + if math.random() < 0.5 then -- Set up the ship to deliver this stuff ship = RandomACDropShip("Any", self.CPUTechName); -- If we can't afford this dropship, then try a rocket instead @@ -206,7 +206,7 @@ function Survival:UpdateActivity() if IsAHuman(passenger) then passenger:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); - if PosRand() < 0.5 then + if math.random() < 0.5 then passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/Base.rte/Activities/Unused/ZombiePit.lua b/Base.rte/Activities/Unused/ZombiePit.lua index 69e624bf7..06f265c87 100644 --- a/Base.rte/Activities/Unused/ZombiePit.lua +++ b/Base.rte/Activities/Unused/ZombiePit.lua @@ -203,7 +203,7 @@ function ZombiePitMission:UpdateActivity() zombie.Pos = attackLZ:GetRandomPoint(); else -- Will appear anywhere when there is no designated LZ - zombie.Pos = Vector(SceneMan.Scene.Width * PosRand(), 0); + zombie.Pos = Vector(SceneMan.Scene.Width * math.random(), 0); end zombie.Team = self.CPUTeam; zombie:SetControllerMode(Controller.CIM_AI, -1); diff --git a/Base.rte/Actors.ini b/Base.rte/Actors.ini index ef0c688e7..2a320f908 100644 --- a/Base.rte/Actors.ini +++ b/Base.rte/Actors.ini @@ -15,9 +15,15 @@ IncludeFile = Base.rte/Actors/Brains/Case/BrainCase.ini IncludeFile = Base.rte/Actors/Brains/Brainbot/Brainbot.ini +// Infantry + +IncludeFile = Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini + + // Mecha IncludeFile = Base.rte/Actors/Mecha/Medic/MedicDrone.ini +IncludeFile = Base.rte/Actors/Mecha/AIBox/AIBox.ini // Wildlife diff --git a/Base.rte/Actors/Brains/Brainbot/Brainbot.ini b/Base.rte/Actors/Brains/Brainbot/Brainbot.ini index b4a3c7afb..472a18249 100644 --- a/Base.rte/Actors/Brains/Brainbot/Brainbot.ini +++ b/Base.rte/Actors/Brains/Brainbot/Brainbot.ini @@ -22,20 +22,20 @@ AddActor = Attachable AtomGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Concrete + CopyOf = Civilian Stuff Resolution = 3 Depth = 0 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Concrete + CopyOf = Civilian Stuff Resolution = 4 Depth = 6 DeepCheck = 1 - JointStrength = 1200 + JointStrength = 1000 JointStiffness = 0.3 BreakWound = AEmitter - CopyOf = Leaking Machinery + CopyOf = Leaking Machinery Heavy JointOffset = Vector X = 0.5 Y = 7 @@ -46,14 +46,14 @@ AddActor = Attachable AddGib = Gib GibParticle = MOPixel CopyOf = Drop Brain Fluid - Count = 180 + Count = 140 Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 AddGib = Gib GibParticle = MOPixel CopyOf = Drop Brain Fluid Dark - Count = 120 + Count = 100 Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 @@ -265,6 +265,22 @@ AddActor = Attachable Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Spark Yellow Particle + Count = 3 + Spread = 3.14 + MaxVelocity = 10 + MinVelocity = 1 + InheritsVel = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Oil Spray Particle + Count = 3 + Spread = 3.14 + MaxVelocity = 10 + MinVelocity = 1 + InheritsVel = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Metal Rust Tiny A @@ -299,7 +315,7 @@ AddActor = Attachable AddActor = Arm PresetName = Brainbot Arm FG - Mass = 5 + Mass = 6 HitsMOs = 0 GetsHitByMOs = 1 SpriteFile = ContentFile @@ -554,7 +570,7 @@ AddActor = AHuman AddToGroup = Brains GoldValue = 100 Buyable = 1 - Mass = 24 + Mass = 30 HitsMOs = 1 GetsHitByMOs = 1 ScriptPath = Base.rte/AI/HumanAI.lua diff --git a/Base.rte/Actors/Brains/Case/BrainCase.ini b/Base.rte/Actors/Brains/Case/BrainCase.ini index 9ce2d96dc..5ebe02187 100644 --- a/Base.rte/Actors/Brains/Case/BrainCase.ini +++ b/Base.rte/Actors/Brains/Case/BrainCase.ini @@ -50,7 +50,7 @@ AddEffect = MOSRotating AddActor = Actor PresetName = Brain Case - Description = Primary field command unit. A brain enclosed within a glass jar that can control bodies/crafts/vehicles and such. It's very fragile by itself, so make sure to guard it at all costs! + Description = Primary field command unit. A jar-enclosed brain that can remotely control bodies, craft and other units. It's very fragile by itself, so make sure to guard it at all costs! AddToGroup = Brains PinStrength = 500 Mass = 43.54 @@ -74,13 +74,13 @@ AddActor = Actor AtomGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Concrete + CopyOf = Civilian Stuff Resolution = 1 Depth = 0 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Concrete + CopyOf = Civilian Stuff Resolution = 4 Depth = 6 DeepCheck = 1 @@ -108,35 +108,51 @@ AddActor = Actor AddGib = Gib GibParticle = MOPixel CopyOf = Spark Yellow 1 - Count = 12 + Count = 6 Spread = 2.25 MaxVelocity = 5 MinVelocity = 8 AddGib = Gib GibParticle = MOPixel CopyOf = Spark Yellow 2 - Count = 12 + Count = 5 Spread = 2.25 MaxVelocity = 20 MinVelocity = 8 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Spark Yellow Particle + Count = 3 + Spread = 3.14 + MaxVelocity = 10 + MinVelocity = 1 + InheritsVel = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Oil Spray Particle + Count = 3 + Spread = 3.14 + MaxVelocity = 10 + MinVelocity = 1 + InheritsVel = 0 AddGib = Gib GibParticle = MOPixel CopyOf = Drop Brain Fluid - Count = 200 + Count = 140 Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 AddGib = Gib GibParticle = MOPixel CopyOf = Drop Brain Fluid Dark - Count = 125 + Count = 100 Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 AddGib = Gib GibParticle = MOPixel CopyOf = Drop Blood - Count = 50 + Count = 40 Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmBGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA000.bmp new file mode 100644 index 000000000..55b00f82d Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmBGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA001.bmp new file mode 100644 index 000000000..021f9b659 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmBGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA002.bmp new file mode 100644 index 000000000..41f8303ab Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmBGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA003.bmp new file mode 100644 index 000000000..f958185d2 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmBGA004.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA004.bmp new file mode 100644 index 000000000..e0cd832bb Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmBGA004.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmFGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA000.bmp new file mode 100644 index 000000000..31542576c Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmFGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA001.bmp new file mode 100644 index 000000000..4e38d1f75 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmFGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA002.bmp new file mode 100644 index 000000000..e5190ea52 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmFGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA003.bmp new file mode 100644 index 000000000..38504e319 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/ArmFGA004.bmp b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA004.bmp new file mode 100644 index 000000000..ceb68c7f0 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/ArmFGA004.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootBGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootBGA000.bmp new file mode 100644 index 000000000..21adf2aac Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootBGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootBGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootBGA001.bmp new file mode 100644 index 000000000..ca6064cc5 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootBGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootBGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootBGA002.bmp new file mode 100644 index 000000000..6ff74aafb Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootBGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootBGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootBGA003.bmp new file mode 100644 index 000000000..e6f3da875 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootBGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootFGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootFGA000.bmp new file mode 100644 index 000000000..9312f1ced Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootFGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootFGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootFGA001.bmp new file mode 100644 index 000000000..ce92ad3e0 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootFGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootFGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootFGA002.bmp new file mode 100644 index 000000000..3ba58511f Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootFGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/FootFGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/FootFGA003.bmp new file mode 100644 index 000000000..c1f308901 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/FootFGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/Gibs/HeadGibA.bmp b/Base.rte/Actors/Infantry/GreenDummy/Gibs/HeadGibA.bmp new file mode 100644 index 000000000..c0df690e2 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/Gibs/HeadGibA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibA.bmp b/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibA.bmp new file mode 100644 index 000000000..dae79e24e Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibB.bmp b/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibB.bmp new file mode 100644 index 000000000..f816cc593 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibB.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini b/Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini new file mode 100644 index 000000000..50205edd9 --- /dev/null +++ b/Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini @@ -0,0 +1,914 @@ +/////////////////////////////////////////////////////////////////////// +// Green Dummy Wounds + + +AddEffect = AEmitter + PresetName = Wound Plastic Green Entry + Mass = 0.0001 + HitsMOs = 0 + GetsHitByMOs = 0 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundA.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -1 + Y = -1 + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Bone + Resolution = 2 + Depth = 10 + DeepGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Bone + Resolution = 3 + Depth = 10 + DeepCheck = 0 + JointStrength = 10000000 + JointStiffness = 1 + DrawAfterParent = 1 + AddEmission = Emission + EmittedParticle = MOPixel + CopyOf = Bone Particle + PresetName = Plastic Particle Green + Color = Color + R = 103 + G = 121 + B = 88 + Spread = 0.1 + MaxVelocity = 5 + MinVelocity = 1 + BurstSound = SoundContainer + CopyOf = Bone Hit + EmissionEnabled = 1 + EmissionCountLimit = 10 + EmissionsIgnoreThis = 1 + ParticlesPerMinute = 0 + BurstSize = 3 + BurstScale = 5 + BurstDamage = 2 + BurstTriggered = 1 + EmissionDamage = 0.12 + + +AddEffect = AEmitter + CopyOf = Wound Plastic Green Entry + PresetName = Wound Plastic Green Exit + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundB.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -2 + Y = -2 + AddEmission = Emission + EmittedParticle = MOPixel + CopyOf = Plastic Particle Green + Spread = 0.1 + MaxVelocity = 10 + MinVelocity = 1 + EmittedParticle = MOPixel + CopyOf = Plastic Particle Green + Spread = 0.1 + MaxVelocity = 10 + MinVelocity = 1 + AddEmission = Emission + EmittedParticle = MOSParticle + CopyOf = Gib Military Micro A + Spread = 0.1 + MaxVelocity = 10 + MinVelocity = 1 + AddEmission = Emission + EmittedParticle = MOPixel + CopyOf = Spark Yellow 1 + Spread = 0.1 + MaxVelocity = 10 + MinVelocity = 1 + BurstSound = SoundContainer + CopyOf = Metal Penetration Hit + EmissionEnabled = 1 + EmissionCountLimit = 10 + EmissionsIgnoreThis = 1 + ParticlesPerMinute = 0 + BurstSize = 6 + BurstScale = 6 + BurstDamage = 2 + BurstTriggered = 1 + EmissionDamage = 0.02 + + +/////////////////////////////////////////////////////////////////////// +// Green Dummy Gibs + + +AddEffect = MOSRotating + PresetName = Green Dummy Head Gib A + Mass = 10 + HitsMOs = 0 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/Gibs/HeadGibA.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -6 + Y = -5 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Bone + Resolution = 4 + Depth = 0 + DeepCheck = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -4 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = 3 + Y = -1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -3 + Y = -5 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = 3 + Y = 2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = 1 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Metal Grey Small A + Offset = Vector + X = -2 + Y = -3.5 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Joint Small C + Offset = Vector + X = -2 + Y = 1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 125 + GibWoundLimit = 4 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddEffect = MOSRotating + PresetName = Green Dummy Rib Cage Gib A + Mass = 26.77 + HitsMOs = 0 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibA.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -3 + Y = -10 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + GibImpulseLimit = 85 + GibWoundLimit = 3 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddEffect = MOSRotating + PresetName = Green Dummy Rib Cage Gib B + Mass = 10.42 + HitsMOs = 0 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/Gibs/RibCageGibB.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -5 + Y = -5 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -4 + Y = -4 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = 0 + Y = 2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -1 + Y = 1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -2 + Y = -5 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Rust Tiny A + Offset = Vector + X = -2 + Y = -1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Metal Grey Small C + Offset = Vector + X = 2 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 85 + GibWoundLimit = 3 + GibSound = SoundContainer + CopyOf = Bone Crack + + +/////////////////////////////////////////////////////////////////////// +// Green Dummy + + +AddEffect = Attachable + PresetName = Green Dummy Head + Mass = 19.03 + HitsMOs = 1 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/HeadA.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -5 + Y = -5 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 6 + Depth = 2 + DeepCheck = 1 + JointStrength = 145 + JointStiffness = 0.1 + BreakWound = AEmitter + CopyOf = Leaking Machinery + JointOffset = Vector + X = 0 + Y = 6 + DrawAfterParent = 1 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Green Dummy Head Gib A + Offset = Vector + X = 0 + Y = 0 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -6 + Y = 0 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Panel White Tiny A + Offset = Vector + X = -2 + Y = 3 + Count = 2 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = 0.5 + Y = 2.5 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 100 + GibWoundLimit = 3 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddActor = Arm + PresetName = Green Dummy Arm FG + Mass = 7 + HitsMOs = 0 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/ArmFGA.bmp + FrameCount = 5 + SpriteOffset = Vector + X = -6 + Y = -3 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + ParentOffset = Vector + X = -1 + Y = -4 + JointStrength = 185 + JointStiffness = 0.5 + BreakWound = AEmitter + CopyOf = Leaking Machinery + JointOffset = Vector + X = -3.5 + Y = -1 + DrawAfterParent = 1 + HeldDevice = None + Hand = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/HandFGA.bmp + MaxLength = 12 + IdleOffset = Vector + X = 5 + Y = 6 + MoveSpeed = 0.2 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -3 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = 3 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -2 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -1 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = 5 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Dark Micro A + Offset = Vector + X = 6 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Dark Micro A + Offset = Vector + X = 0 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Grey Micro A + Offset = Vector + X = -4.5 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 50 + GibWoundLimit = 2 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddActor = Arm + CopyOf = Green Dummy Arm FG + PresetName = Green Dummy Arm BG + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/ArmBGA.bmp + FrameCount = 5 + Hand = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/HandBGA.bmp + + +AddActor = Attachable + PresetName = Green Dummy Foot FG + Mass = 4 + HitsMOs = 0 + GetsHitByMOs = 0 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/FootFGA.bmp + FrameCount = 4 + SpriteOffset = Vector + X = -5 + Y = -3 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 2 + DeepCheck = 0 + JointStrength = 155 + JointStiffness = 0.5 + BreakWound = AEmitter + CopyOf = Leaking Machinery + JointOffset = Vector + X = -3 + Y = -2 + DrawAfterParent = 1 + + +AddActor = Attachable + CopyOf = Green Dummy Foot FG + PresetName = Green Dummy Foot BG + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/FootBGA.bmp + FrameCount = 4 + + +AddActor = Leg + PresetName = Green Dummy Leg FG + Mass = 10 + HitsMOs = 0 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/LegFGA.bmp + FrameCount = 5 + SpriteOffset = Vector + X = -7 + Y = -7 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + JointStrength = 200 + JointStiffness = 0.5 + BreakWound = AEmitter + CopyOf = Leaking Machinery + JointOffset = Vector + X = -5 + Y = 2 + DrawAfterParent = 0 + Foot = Attachable + CopyOf = Green Dummy Foot FG + ParentOffset = Vector + X = -11 + Y = -10 + ExtendedOffset = Vector + X = 14 + Y = 0 + ContractedOffset = Vector + X = 7 + Y = 0 + IdleOffset = Vector + X = 1 + Y = 3 + MoveSpeed = 0.4 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -6 + Y = 1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -5 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = 0 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -7 + Y = 0 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -3 + Y = 0 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -2 + Y = -2 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Pipe Small C + Offset = Vector + X = 3 + Y = 0 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 60 + GibWoundLimit = 3 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddActor = Leg + CopyOf = Green Dummy Leg FG + PresetName = Green Dummy Leg BG + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/LegBGA.bmp + FrameCount = 5 + Foot = Attachable + CopyOf = Green Dummy Foot BG + ParentOffset = Vector + X = -11 + Y = -10 + + +AddActor = AHuman + PresetName = Green Dummy + Description = TradeStar's factory worker unit. Agile, but not fit for warfare! + AddToGroup = Actors + AddToGroup = Actors - Light + Mass = 34 + GoldValue = 45 + HitsMOs = 1 + GetsHitByMOs = 1 + ScriptPath = Base.rte/AI/HumanAI.lua + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Infantry/GreenDummy/TorsoA.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -4 + Y = -16 + AngularVel = 0 + EntryWound = AEmitter + CopyOf = Wound Plastic Green Entry + ExitWound = AEmitter + CopyOf = Wound Plastic Green Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 4 + Depth = 0 + DeepGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Civilian Stuff + Resolution = 6 + Depth = 3 + DeepCheck = 0 + BodyHitSound = SoundContainer + CopyOf = Bone Crack + PainSound = SoundContainer + CopyOf = Robot Pain + DeathSound = SoundContainer + CopyOf = Robot Death + DeviceSwitchSound = SoundContainer + CopyOf = Device Switch + Status = 0 + Health = 100 + ImpulseDamageThreshold = 2600 + AimAngle = 0 + AimDistance = 30 + Perceptiveness = 1 + CharHeight = 100 + HolsterOffset = Vector + X = -6 + Y = -8 + Head = Attachable + CopyOf = Green Dummy Head + ParentOffset = Vector + X = -1 + Y = -13 + Jetpack = AEmitter + CopyOf = Jetpack + ParentOffset = Vector + X = -6 + Y = -1 + JumpTime = 1.5 + FGArm = Arm + CopyOf = Green Dummy Arm FG + ParentOffset = Vector + X = 0 + Y = -8 + BGArm = Arm + CopyOf = Green Dummy Arm BG + ParentOffset = Vector + X = 4 + Y = -9 + FGLeg = Leg + CopyOf = Green Dummy Leg FG + ParentOffset = Vector + X = 0 + Y = 1 + BGLeg = Leg + CopyOf = Green Dummy Leg BG + ParentOffset = Vector + X = 2 + Y = 1 + HandGroup = AtomGroup + CopyOf = Human Hand + FGFootGroup = AtomGroup + CopyOf = Human Foot + BGFootGroup = AtomGroup + CopyOf = Human Foot + StrideSound = SoundContainer + CopyOf = Robot Stride + StandLimbPath = LimbPath + PresetName = Green Dummy Stand Path + StartOffset = Vector + X = 0 + Y = 17 + StartSegCount = 0 + SlowTravelSpeed = 0.1 + NormalTravelSpeed = 0.5 + FastTravelSpeed = 1.5 + PushForce = 1800 + StandLimbPathBG = LimbPath + CopyOf = Green Dummy Stand Path + PresetName = Green Dummy Stand Path BG + StartOffset = Vector + X = 5 + Y = 17 + WalkLimbPath = LimbPath + CopyOf = Human Walk Path + PresetName = Green Dummy Walk Path + StartOffset = Vector + X = 6 + Y = -3 + NormalTravelSpeed = 3.4 + CrouchLimbPath = LimbPath + CopyOf = Human Crouch Path + CrawlLimbPath = LimbPath + CopyOf = Human Crawl Path + ArmCrawlLimbPath = LimbPath + CopyOf = Human Arm Crawl Path + ClimbLimbPath = LimbPath + CopyOf = Human Climb Path + JumpLimbPath = LimbPath + CopyOf = Human Jump Path + DislodgeLimbPath = LimbPath + CopyOf = Human Dislodge Path + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Green Dummy Rib Cage Gib A + Offset = Vector + X = -2 + Y = -3 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Green Dummy Rib Cage Gib B + Offset = Vector + X = 0 + Y = -5 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Metal Rusty Small C + Offset = Vector + X = -3 + Y = -6 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Tiny A + Offset = Vector + X = -3 + Y = -9 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -1 + Y = -1 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Military Micro A + Offset = Vector + X = -4 + Y = -10 + Count = 1 + Spread = 0 + MinVelocity = 0 + MaxVelocity = 0 + GibImpulseLimit = 3000 + GibWoundLimit = 5 + GibSound = SoundContainer + CopyOf = Bone Crack \ No newline at end of file diff --git a/Base.rte/Actors/Infantry/GreenDummy/HandBGA.bmp b/Base.rte/Actors/Infantry/GreenDummy/HandBGA.bmp new file mode 100644 index 000000000..f8bbad5dc Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/HandBGA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/HandFGA.bmp b/Base.rte/Actors/Infantry/GreenDummy/HandFGA.bmp new file mode 100644 index 000000000..3acf62c2a Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/HandFGA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/HeadA.bmp b/Base.rte/Actors/Infantry/GreenDummy/HeadA.bmp new file mode 100644 index 000000000..8049f5cea Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/HeadA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegBGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegBGA000.bmp new file mode 100644 index 000000000..6aa6d0c19 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegBGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegBGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegBGA001.bmp new file mode 100644 index 000000000..f5e72fce0 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegBGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegBGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegBGA002.bmp new file mode 100644 index 000000000..201e5eeed Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegBGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegBGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegBGA003.bmp new file mode 100644 index 000000000..edcbd4b73 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegBGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegBGA004.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegBGA004.bmp new file mode 100644 index 000000000..f9b91cce0 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegBGA004.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegFGA000.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegFGA000.bmp new file mode 100644 index 000000000..0df15fc1e Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegFGA000.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegFGA001.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegFGA001.bmp new file mode 100644 index 000000000..8fdad0b3d Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegFGA001.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegFGA002.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegFGA002.bmp new file mode 100644 index 000000000..34e30743c Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegFGA002.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegFGA003.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegFGA003.bmp new file mode 100644 index 000000000..9844a949a Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegFGA003.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/LegFGA004.bmp b/Base.rte/Actors/Infantry/GreenDummy/LegFGA004.bmp new file mode 100644 index 000000000..34779feae Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/LegFGA004.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/TorsoA.bmp b/Base.rte/Actors/Infantry/GreenDummy/TorsoA.bmp new file mode 100644 index 000000000..24649979c Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/TorsoA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundA.bmp b/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundA.bmp new file mode 100644 index 000000000..0d19dc9f3 Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundA.bmp differ diff --git a/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundB.bmp b/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundB.bmp new file mode 100644 index 000000000..34cb1a1ff Binary files /dev/null and b/Base.rte/Actors/Infantry/GreenDummy/Wounds/GreenWoundB.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/AIBox.ini b/Base.rte/Actors/Mecha/AIBox/AIBox.ini new file mode 100644 index 000000000..387919617 --- /dev/null +++ b/Base.rte/Actors/Mecha/AIBox/AIBox.ini @@ -0,0 +1,353 @@ +/////////////////////////////////////////////////////////////////////// +// AI Box + + +AddActor = Turret + PresetName = AI Box Top + ScriptPath = Base.rte/Scripts/Shared/FlippedFrame.lua + Mass = 40 + HitsMOs = 1 + GetsHitByMOs = 1 + CollidesWithTerrainWhenAttached = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Mecha/AIBox/DroneTop.bmp + FrameCount = 2 + SpriteOffset = Vector + X = -13 + Y = -15 + EntryWound = AEmitter + CopyOf = Leaking Machinery Light + ExitWound = AEmitter + CopyOf = Leaking Machinery + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Military Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Military Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + JointStrength = 4000 + JointStiffness = 0.9 + BreakWound = AEmitter + CopyOf = Leaking Machinery Heavy + JointOffset = Vector + X = 0 + Y = 9 + DrawAfterParent = 1 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Oil Spray Particle + Count = 5 + Spread = 3.1 + MaxVelocity = 10 + MinVelocity = 1 + LifeVariation = 0.30 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Spark Yellow Particle + Count = 5 + Spread = 3.1 + MaxVelocity = 10 + MinVelocity = 1 + LifeVariation = 0.30 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Explosion Smoke 1 + Count = 5 + Spread = 3.1 + MaxVelocity = 10 + MinVelocity = 1 + LifeVariation = 0.50 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Explosion Smoke 2 + Count = 5 + Spread = 3.1 + MaxVelocity = 10 + MinVelocity = 1 + LifeVariation = 0.50 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Pipe Small A + Offset = Vector + X = 1 + Y = -1 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Pipe Small D + Offset = Vector + X = 2 + Y = 3 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Pipe Small D + Offset = Vector + X = 2 + Y = 1 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Grey Tiny A + Offset = Vector + X = -1.5 + Y = -2.5 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Grey Tiny A + Offset = Vector + X = 0.5 + Y = -0.5 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Dark Tiny A + Offset = Vector + X = 1.5 + Y = -2.5 + GibImpulseLimit = 6000 + GibWoundLimit = 26 + GibSound = SoundContainer + CopyOf = Crash Woosh + + +AddActor = Leg + PresetName = AI Box Leg FG + Mass = 10 + HitsMOs = 1 + GetsHitByMOs = 1 + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Mecha/AIBox/LegFG.bmp + FrameCount = 5 + SpriteOffset = Vector + X = -6 + Y = -7 + AngularVel = 6 + EntryWound = AEmitter + CopyOf = Dent Metal Light + ExitWound = AEmitter + CopyOf = Wound Bone Exit + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Military Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + JointStrength = 165 + JointStiffness = 0.5 + BreakWound = AEmitter + CopyOf = Wound Bone Break + JointOffset = Vector + X = -2 + Y = 6 + DrawAfterParent = 0 + ExtendedOffset = Vector + X = 8 + Y = -10 + ContractedOffset = Vector + X = 4 + Y = 0 + IdleOffset = Vector + X = 4 + Y = 4 + MoveSpeed = 0.4 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Pipe Small A + Offset = Vector + X = -3 + Y = 0 + GibImpulseLimit = 2200 + GibWoundLimit = 5 + GibSound = SoundContainer + CopyOf = Bone Crack + + +AddActor = Leg + CopyOf = AI Box Leg FG + PresetName = AI Box Leg BG + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Mecha/AIBox/LegBG.bmp + FrameCount = 5 + SpriteOffset = Vector + X = -6 + Y = -7 + + +AddActor = ACrab + PresetName = AI Box + Description = Artificial Intelligence control module that boosts your AI control capacity by 10 units. Keep them safe; if your capacity drops under your unit count, the AI stops functioning! + AddToGroup = Actors + Mass = 50 + GoldValue = 250 + Buyable = 0 + HitsMOs = 1 + GetsHitByMOs = 1 + ScriptPath = Base.rte/AI/CrabAI.lua + SpriteFile = ContentFile + FilePath = Base.rte/Actors/Mecha/AIBox/MountMobile.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -9 + Y = -7 + EntryWound = AEmitter + CopyOf = Leaking Machinery Light + ExitWound = AEmitter + CopyOf = Leaking Machinery Light + AtomGroup = AtomGroup + AutoGenerate = 1 + Material = Material + CopyOf = Military Stuff + Resolution = 4 + Depth = 0 + DeepCheck = 0 + BodyHitSound = SoundContainer + CopyOf = Metal Body Blunt Hit + PainSound = SoundContainer + CopyOf = Robot Pain + DeathSound = SoundContainer + CopyOf = Robot Death + // AddSound = ContentFile + // FilePath = Base.rte/Actors/Brains/Case/Sounds/EnergyExplosion.wav + DeviceSwitchSound = SoundContainer + CopyOf = Device Switch + Status = 0 + Health = 100 + ImpulseDamageThreshold = 5000 + AimAngle = 0 + AimRange = 1.57 + AimDistance = 30 + Perceptiveness = 0.1 + CharHeight = 100 + Turret = Turret + CopyOf = AI Box Top + ParentOffset = Vector + X = 0 + Y = -5 + Jetpack = AEmitter + CopyOf = Jump Light + BurstSpacing = 1100 + ParentOffset = Vector + X = 0 + Y = 0 + DrawAfterParent = 0 + JumpTime = 1 + LFGLeg = Leg + CopyOf = AI Box Leg FG + ParentOffset = Vector + X = -6 + Y = 3 + LBGLeg = Leg + CopyOf = AI Box Leg BG + ParentOffset = Vector + X = -4 + Y = 2 + RFGLeg = Leg + CopyOf = AI Box Leg FG + ParentOffset = Vector + X = 6 + Y = 3 + RBGLeg = Leg + CopyOf = AI Box Leg BG + ParentOffset = Vector + X = 4 + Y = 2 + LFootGroup = AtomGroup + CopyOf = Crab Foot + RFootGroup = AtomGroup + CopyOf = Crab Foot + StrideSound = SoundContainer + CopyOf = Robot Stride + LStandLimbPath = LimbPath + PresetName = AI Box Stand Path Left + StartOffset = Vector + X = -6 + Y = 6 + StartSegCount = 0 + SlowTravelSpeed = 0.4 + NormalTravelSpeed = 0.8 + FastTravelSpeed = 1.8 + PushForce = 2200 + LWalkLimbPath = LimbPath + PresetName = AI Box Walk Path Left + StartOffset = Vector + X = -13 + Y = -12 + StartSegCount = 4 + AddSegment = Vector + X = 10 + Y = 0 + AddSegment = Vector + X = 5 + Y = 8 + AddSegment = Vector + X = 0 + Y = 3 + AddSegment = Vector + X = 0 + Y = 3 + AddSegment = Vector + X = 0 + Y = 3 + AddSegment = Vector + X = -2 + Y = 2 + AddSegment = Vector + X = -13 + Y = 0 + SlowTravelSpeed = 2.5 + NormalTravelSpeed = 3.5 + FastTravelSpeed = 5.5 + PushForce = 6000 + LDislodgeLimbPath = LimbPath + PresetName = AI Box Dislodge Path Left + StartOffset = Vector + X = -1 + Y = -10 + StartSegCount = 0 + AddSegment = Vector + X = 0 + Y = 6 + SlowTravelSpeed = 2.5 + NormalTravelSpeed = 3.5 + FastTravelSpeed = 4.5 + PushForce = 12000 + RStandLimbPath = LimbPath + CopyOf = AI Box Stand Path Left + PresetName = AI Box Stand Path Right + StartOffset = Vector + X = 6 + Y = 6 + RWalkLimbPath = LimbPath + CopyOf = AI Box Walk Path Left + PresetName = AI Box Walk Path Right + StartOffset = Vector + X = -2 + Y = -12 + RDislodgeLimbPath = LimbPath + CopyOf = AI Box Dislodge Path Left + PresetName = AI Box Dislodge Path Right + StartOffset = Vector + X = 2 + Y = -10 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Metal Grey Small B + Offset = Vector + X = 0 + Y = -1 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Device Small A + Offset = Vector + X = -1 + Y = -3 + GibImpulseLimit = 8000 + GibWoundLimit = 10 + GibSound = SoundContainer + CopyOf = Bone Crack \ No newline at end of file diff --git a/Base.rte/Actors/Mecha/AIBox/DroneTop000.bmp b/Base.rte/Actors/Mecha/AIBox/DroneTop000.bmp new file mode 100644 index 000000000..d811a438a Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/DroneTop000.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/DroneTop001.bmp b/Base.rte/Actors/Mecha/AIBox/DroneTop001.bmp new file mode 100644 index 000000000..1188aa992 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/DroneTop001.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegBG000.bmp b/Base.rte/Actors/Mecha/AIBox/LegBG000.bmp new file mode 100644 index 000000000..615c24b56 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegBG000.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegBG001.bmp b/Base.rte/Actors/Mecha/AIBox/LegBG001.bmp new file mode 100644 index 000000000..0efd57f82 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegBG001.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegBG002.bmp b/Base.rte/Actors/Mecha/AIBox/LegBG002.bmp new file mode 100644 index 000000000..eeae86a0f Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegBG002.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegBG003.bmp b/Base.rte/Actors/Mecha/AIBox/LegBG003.bmp new file mode 100644 index 000000000..201b7e166 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegBG003.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegBG004.bmp b/Base.rte/Actors/Mecha/AIBox/LegBG004.bmp new file mode 100644 index 000000000..9da52b374 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegBG004.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegFG000.bmp b/Base.rte/Actors/Mecha/AIBox/LegFG000.bmp new file mode 100644 index 000000000..132dd52ce Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegFG000.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegFG001.bmp b/Base.rte/Actors/Mecha/AIBox/LegFG001.bmp new file mode 100644 index 000000000..33108a159 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegFG001.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegFG002.bmp b/Base.rte/Actors/Mecha/AIBox/LegFG002.bmp new file mode 100644 index 000000000..65bf2fc8a Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegFG002.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegFG003.bmp b/Base.rte/Actors/Mecha/AIBox/LegFG003.bmp new file mode 100644 index 000000000..af71c85a3 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegFG003.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/LegFG004.bmp b/Base.rte/Actors/Mecha/AIBox/LegFG004.bmp new file mode 100644 index 000000000..2a0675ba2 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/LegFG004.bmp differ diff --git a/Base.rte/Actors/Mecha/AIBox/MountMobile.bmp b/Base.rte/Actors/Mecha/AIBox/MountMobile.bmp new file mode 100644 index 000000000..ecd91fe42 Binary files /dev/null and b/Base.rte/Actors/Mecha/AIBox/MountMobile.bmp differ diff --git a/Base.rte/Actors/Mecha/Medic/Medic.lua b/Base.rte/Actors/Mecha/Medic/Medic.lua index 2ded01722..96e7a78aa 100644 --- a/Base.rte/Actors/Mecha/Medic/Medic.lua +++ b/Base.rte/Actors/Mecha/Medic/Medic.lua @@ -1,26 +1,40 @@ function Create(self) self.healTimer = Timer(); - self.healTimer:SetSimTimeLimitMS(150); + self.baseHealDelay = 150; + self.healIncrementPerTarget = 100; + self.healIncrementPerWound = 50; + self.healTimer:SetSimTimeLimitMS(self.baseHealDelay); self.crossTimer = Timer(); self.crossTimer:SetSimTimeLimitMS(800); - self.healRange = 100 + self.Radius; + self.colors = {135, 133, 149, 148, 145}; + self.maxHealRange = 100 + self.Radius; self.healStrength = 1; self.healTargets = {}; end - function Update(self) - if self.healTimer:IsPastSimTimeLimit() then - self.healTimer:Reset(); - local parent = self:GetParent(); - if parent and IsActor(parent) then - parent = ToActor(parent); + local parent = self:GetParent(); + if parent and IsActor(parent) then + parent = ToActor(parent); + local healRange = self.maxHealRange * (1 - (self.WoundCount/self.GibWoundLimit)); + if (parent:IsPlayerControlled() and parent:GetController():IsState(Controller.WEAPON_FIRE)) or #self.healTargets > 0 then + local screen = ActivityMan:GetActivity():ScreenOfPlayer(parent:GetController().Player); + if screen ~= -1 then + PrimitiveMan:DrawCirclePrimitive(screen, self.Pos, healRange, self.colors[math.random(#self.colors)]); + for i = 1, math.random(10, 20) do + local vector = Vector(healRange, 0):RadRotate(6.28 * math.random()); + PrimitiveMan:DrawLinePrimitive(screen, self.Pos + vector * RangeRand(0.66, 0.99), self.Pos + vector, self.colors[math.random(#self.colors)]); + end + end + end + if self.healTimer:IsPastSimTimeLimit() then + self.healTimer:Reset(); for i = 1, #self.healTargets do local targetFound = false; local healTarget = self.healTargets[i]; if healTarget and IsActor(healTarget) and (healTarget.Health < healTarget.MaxHealth or healTarget.TotalWoundCount > 0) and healTarget.Vel.Largest < 10 then local trace = SceneMan:ShortestDistance(self.Pos, healTarget.Pos, false); - if (trace.Magnitude - healTarget.Radius) < self.healRange then + if (trace.Magnitude - healTarget.Radius) < healRange then if SceneMan:CastObstacleRay(self.Pos, trace, Vector(), Vector(), parent.ID, parent.IgnoresWhichTeam, rte.grassID, 5) < 0 then targetFound = true; end @@ -47,14 +61,14 @@ function Update(self) for act in MovableMan.Actors do if act.Team == parent.Team and act.ID ~= parent.ID and (act.Health < act.MaxHealth or act.TotalWoundCount > 0) and act.Vel.Largest < 5 then local trace = SceneMan:ShortestDistance(self.Pos, act.Pos, false); - if (trace.Magnitude - act.Radius) < (self.healRange * 0.9) then - if SceneMan:CastObstacleRay(self.Pos, trace, Vector(), Vector(), parent.ID, parent.IgnoresWhichTeam, 0, 3) < 0 then + if (trace.Magnitude - act.Radius) < (healRange * 0.9) then + if SceneMan:CastObstacleRay(self.Pos, trace, Vector(), Vector(), parent.ID, parent.IgnoresWhichTeam, rte.airID, 3) < 0 then table.insert(self.healTargets, act); end end end end - self.healTimer:SetSimTimeLimitMS(100 + #self.healTargets * 50); + self.healTimer:SetSimTimeLimitMS(self.baseHealDelay + (self.healIncrementPerWound * self.WoundCount) + (#self.healTargets * self.healIncrementPerTarget)); end end end \ No newline at end of file diff --git a/Base.rte/Actors/Mecha/Medic/MedicDrone.ini b/Base.rte/Actors/Mecha/Medic/MedicDrone.ini index df778e3c9..520e74656 100644 --- a/Base.rte/Actors/Mecha/Medic/MedicDrone.ini +++ b/Base.rte/Actors/Mecha/Medic/MedicDrone.ini @@ -27,7 +27,7 @@ AddEffect = MOSParticle EffectStopStrength = 0 -AddEffect = Attachable +AddActor = Turret PresetName = Medic Drone Top Mass = 25 HitsMOs = 1 @@ -41,9 +41,9 @@ AddEffect = Attachable X = -9 Y = -8 EntryWound = AEmitter - CopyOf = Leaking Machinery Heavy + CopyOf = Leaking Machinery ExitWound = AEmitter - CopyOf = Leaking Machinery Light + CopyOf = Leaking Machinery AtomGroup = AtomGroup AutoGenerate = 1 Material = Material @@ -66,6 +66,14 @@ AddEffect = Attachable X = 0 Y = 7 DrawAfterParent = 1 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Spark Yellow Particle + Count = 5 + Spread = 3.1 + MaxVelocity = 10 + MinVelocity = 1 + LifeVariation = 0.30 AddGib = Gib GibParticle = MOSRotating CopyOf = Gib Pipe Small A @@ -177,7 +185,7 @@ AddActor = ACrab Description = Send this into the battlefield and place it near a units to heal them. AddToGroup = Actors Mass = 45 - GoldValue = 110 + GoldValue = 100 HitsMOs = 1 GetsHitByMOs = 1 ScriptPath = Base.rte/AI/CrabAI.lua @@ -210,11 +218,11 @@ AddActor = ACrab Health = 100 ImpulseDamageThreshold = 5000 AimAngle = 0 - AimRange = 0.5 + AimRange = 1.57 AimDistance = 30 Perceptiveness = 0.1 CharHeight = 100 - AddAttachable = Attachable + Turret = Turret CopyOf = Medic Drone Top ParentOffset = Vector X = 0 diff --git a/Base.rte/Actors/Shared.ini b/Base.rte/Actors/Shared.ini index bd94e6558..00e267a4e 100644 --- a/Base.rte/Actors/Shared.ini +++ b/Base.rte/Actors/Shared.ini @@ -515,7 +515,8 @@ AddEffect = AEmitter MaxVelocity = 26 MinVelocity = 10 ParticlesPerMinute = 10800 - BurstSize = 7 + BurstSize = 8 + BurstSpacing = 200 AddEffect = AEmitter diff --git a/Base.rte/Craft/DropShips/DropshipMK1.ini b/Base.rte/Craft/DropShips/DropshipMK1.ini index 9251a5794..c60e797f6 100644 --- a/Base.rte/Craft/DropShips/DropshipMK1.ini +++ b/Base.rte/Craft/DropShips/DropshipMK1.ini @@ -788,7 +788,7 @@ AddEffect = MOSRotating AddEffect = AEmitter PresetName = Dropship Engine A Left - Mass = 600 + Mass = 300 HitsMOs = 1 GetsHitByMOs = 1 SpriteFile = ContentFile @@ -1031,7 +1031,7 @@ AddEffect = AEmitter AddEffect = AEmitter PresetName = Dropship Engine A Right - Mass = 600 + Mass = 300 HitsMOs = 1 GetsHitByMOs = 1 SpriteFile = ContentFile @@ -1446,11 +1446,13 @@ AddActor = ACDropShip Description = Trade Star's reliable and safe dropship. Its tough armor can withstand numerous hits while delivering or transporting troops to the field. Its powerful thrusters allow it to carry even very heavy loads. Equipped with two underslung machine gun turrets. AddToGroup = Craft Mass = 2400 - MaxMass = 3600 + MaxMass = 3700 MaxPassengers = 3 HitsMOs = 1 GetsHitByMOs = 1 - ScriptPath = Base.rte/Craft/Dropships/DropshipMK1.lua + ScriptPath = Base.rte/AI/DropShipAI.lua + ScriptPath = Base.rte/Craft/Shared/ScuttleExplosions.lua + ScriptPath = Base.rte/Scripts/Shared/RandomFrame.lua SpriteFile = ContentFile FilePath = Base.rte/Craft/Dropships/HullA.bmp FrameCount = 2 @@ -1461,7 +1463,8 @@ AddActor = ACDropShip CopyOf = Dent Metal ExitWound = AEmitter CopyOf = Dent Metal - GoldValue = 300 + GoldValue = 500 + DeliveryDelayMultiplier = 2.0 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material @@ -1482,7 +1485,7 @@ AddActor = ACDropShip StableVelocityThreshold = Vector X = 200 Y = 200 - ImpulseDamageThreshold = 9000 + ImpulseDamageThreshold = 10000 CharHeight = 100 AddEmitter = AEmitter CopyOf = Machine Gun Turret @@ -1499,13 +1502,13 @@ AddActor = ACDropShip ParentOffset = Vector X = -49 Y = -3 - Mass = 100 +// Mass = 100 RThruster = AEmitter CopyOf = Dropship Engine A Right ParentOffset = Vector X = 49 Y = -3 - Mass = 100 +// Mass = 100 URThruster = AEmitter CopyOf = Dropship Retro Thruster ParentOffset = Vector @@ -1538,21 +1541,19 @@ AddActor = ACDropShip Y = 28 Velocity = Vector X = 0 - Y = 6 + Y = 5 Radius = 22 Range = 45 CrashSound = SoundContainer CopyOf = Metal Body Blunt Hit Large CanLand = 0 - GibImpulseLimit = 18000 - GibWoundLimit = 60 + GibImpulseLimit = 20000 + GibWoundLimit = 75 GibSound = SoundContainer CopyOf = Ship Explosion AddGib = Gib GibParticle = AEmitter - CopyOf = Fuel Fire Trace Gray - PresetName = Ship Explosion - LifeTime = 175 + CopyOf = Ship Explosion Count = 8 Spread = 2.25 MaxVelocity = 20 @@ -1578,12 +1579,11 @@ AddActor = ACDropShip AddGib = Gib GibParticle = MOSRotating CopyOf = Flame Ball 1 - PresetName = Flame Ball Dropship - LifeTime = 400 - Count = 15 + Count = 20 Spread = 3.1 MaxVelocity = 6 MinVelocity = 4 + LifeVariation = 0.30 AddGib = Gib GibParticle = MOSParticle CopyOf = Explosion Smoke 1 diff --git a/Base.rte/Craft/DropShips/DropshipMK1.lua b/Base.rte/Craft/DropShips/DropshipMK1.lua deleted file mode 100644 index 0ef1c787b..000000000 --- a/Base.rte/Craft/DropShips/DropshipMK1.lua +++ /dev/null @@ -1,37 +0,0 @@ -dofile("Base.rte/Constants.lua") -require("AI/NativeDropShipAI") - -function Create(self) - self.AI = NativeDropShipAI:Create(self); - self.Frame = math.random(0, self.FrameCount - 1); - - self.explosionTimer = Timer(); - self.explosiondelay = 3000 / math.sqrt(self.Radius + 1); - - self.height = ToMOSprite(self):GetSpriteHeight(); - self.width = ToMOSprite(self):GetSpriteWidth(); -end - -function UpdateAI(self) - self.AI:Update(self); -end - -function Update(self) - -- Re-orient the craft at 180 degrees to help rotational AI - if self.RotAngle > math.pi then - self.RotAngle = self.RotAngle - (math.pi * 2); - end - if self.RotAngle < -math.pi then - self.RotAngle = self.RotAngle + (math.pi * 2); - end - -- Explosion effects on scuttle - if self.Status > Actor.UNSTABLE or self.AIMode == Actor.AIMODE_SCUTTLE then - if self.explosionTimer:IsPastSimMS(self.explosiondelay) then - self.explosionTimer:Reset(); - local expl = CreateAEmitter("Scuttle Explosion"); - expl.Pos = self.Pos + Vector(self.width / 2, self.height / 2):RadRotate(self.RotAngle) * RangeRand(-0.8, 0.8); - expl.Vel = self.Vel; - MovableMan:AddParticle(expl); - end - end -end \ No newline at end of file diff --git a/Base.rte/Craft/Rockets/MK2/RocketMK2.ini b/Base.rte/Craft/Rockets/MK2/RocketMK2.ini index 746d77411..2486ab5f6 100644 --- a/Base.rte/Craft/Rockets/MK2/RocketMK2.ini +++ b/Base.rte/Craft/Rockets/MK2/RocketMK2.ini @@ -533,6 +533,7 @@ AddActor = ACRocket HitsMOs = 1 GetsHitByMOs = 1 ScriptPath = Base.rte/AI/RocketAI.lua + ScriptPath = Base.rte/Craft/Shared/ScuttleExplosions.lua SpriteFile = ContentFile FilePath = Base.rte/Craft/Rockets/MK2/RocketMK2.bmp FrameCount = 6 @@ -543,18 +544,17 @@ AddActor = ACRocket CopyOf = Gas Leak ExitWound = AEmitter CopyOf = Gas Leak - GoldValue = 240 - DeliveryDelayMultiplier = 0.60 + GoldValue = 300 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Civilian Stuff + CopyOf = Military Stuff Resolution = 8 Depth = 0 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Civilian Stuff + CopyOf = Military Stuff Resolution = 20 Depth = 10 DeepCheck = 1 @@ -695,9 +695,7 @@ AddActor = ACRocket CopyOf = Ship Explosion AddGib = Gib GibParticle = AEmitter - CopyOf = Fuel Fire Trace Gray - PresetName = Ship Explosion - LifeTime = 175 + CopyOf = Ship Explosion Count = 8 Spread = 2.25 MaxVelocity = 20 @@ -714,12 +712,11 @@ AddActor = ACRocket AddGib = Gib GibParticle = MOSRotating CopyOf = Flame Ball 1 - PresetName = Flame Ball Dropship - LifeTime = 400 Count = 15 Spread = 3.1 MaxVelocity = 6 MinVelocity = 4 + LifeVariation = 0.20 AddGib = Gib GibParticle = MOSParticle CopyOf = Explosion Smoke 1 diff --git a/Base.rte/Craft/Shared/MGTurret.lua b/Base.rte/Craft/Shared/MGTurret.lua index 0f58c28cd..0aba8816d 100644 --- a/Base.rte/Craft/Shared/MGTurret.lua +++ b/Base.rte/Craft/Shared/MGTurret.lua @@ -28,25 +28,25 @@ function Update(self) end end if math.abs(self.rotation) > 0.001 then - self.rotation = self.rotation / (1 + self.turnSpeed * 2); + self.rotation = self.rotation/(1 + self.turnSpeed * 2); else self.rotation = 0; end if math.abs(self.verticalFactor) > 0.001 then - self.verticalFactor = self.verticalFactor / (1 + self.turnSpeed * 4); + self.verticalFactor = self.verticalFactor/(1 + self.turnSpeed * 4); else self.verticalFactor = 0; end -- Aim directly away from parent - local posTrace = SceneMan:ShortestDistance(parent.Pos, self.Pos, SceneMan.SceneWrapsX):SetMagnitude(self.searchRange / 2); - self.RotAngle = (1.57 * self.verticalFactor + posTrace.AbsRadAngle + (parent.HFlipped and math.pi or 0)) / (1 + self.verticalFactor) - self.rotation; + local posTrace = SceneMan:ShortestDistance(parent.Pos, self.Pos, SceneMan.SceneWrapsX):SetMagnitude(self.searchRange/2); + self.RotAngle = (1.57 * self.verticalFactor + posTrace.AbsRadAngle + (parent.HFlipped and math.pi or 0))/(1 + self.verticalFactor) - self.rotation; if self.areaMode then -- Area Mode - local aimPos = self.Pos + Vector((self.searchRange / 2), 0):RadRotate(self.RotAngle); + local aimPos = self.Pos + Vector((self.searchRange/2), 0):RadRotate(self.RotAngle); -- Debug: visualize aim area if self.showAim then - PrimitiveMan:DrawCirclePrimitive(self.Team, aimPos, (self.searchRange / 2), 13); + PrimitiveMan:DrawCirclePrimitive(self.Team, aimPos, (self.searchRange/2), 13); end - local aimTarget = MovableMan:GetClosestEnemyActor(self.Team, aimPos, (self.searchRange / 2), Vector()); + local aimTarget = MovableMan:GetClosestEnemyActor(self.Team, aimPos, (self.searchRange/2), Vector()); if aimTarget then -- Debug: visualize search trace if self.showAim then @@ -69,11 +69,11 @@ function Update(self) local target; local aimTrace = Vector(self.searchRange, 0):RadRotate(self.RotAngle); -- Search for MOs directly in line of sight of two rays - local moCheck1 = SceneMan:CastMORay(self.Pos, aimTrace:RadRotate(1 / math.sqrt(self.searchRange)), parent.ID, self.Team, 0, false, 5); + local moCheck1 = SceneMan:CastMORay(self.Pos, aimTrace:RadRotate(1/math.sqrt(self.searchRange)), parent.ID, self.Team, 0, false, 5); if moCheck1 ~= rte.NoMOID then target = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck1).RootID); else - local moCheck2 = SceneMan:CastMORay(self.Pos, aimTrace:RadRotate(-1 / math.sqrt(self.searchRange)), parent.ID, self.Team, 0, false, 5); + local moCheck2 = SceneMan:CastMORay(self.Pos, aimTrace:RadRotate(-1/math.sqrt(self.searchRange)), parent.ID, self.Team, 0, false, 5); if moCheck2 ~= rte.NoMOID then target = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck2).RootID); end @@ -89,8 +89,8 @@ function Update(self) end -- Debug: visualize aim traces if self.showAim then - PrimitiveMan:DrawLinePrimitive(self.Team, self.Pos, self.Pos + aimTrace:RadRotate(1 / math.sqrt(self.searchRange)), color); - PrimitiveMan:DrawLinePrimitive(self.Team, self.Pos, self.Pos + aimTrace:RadRotate(-1 / math.sqrt(self.searchRange)), color); + PrimitiveMan:DrawLinePrimitive(self.Team, self.Pos, self.Pos + aimTrace:RadRotate(1/math.sqrt(self.searchRange)), color); + PrimitiveMan:DrawLinePrimitive(self.Team, self.Pos, self.Pos + aimTrace:RadRotate(-1/math.sqrt(self.searchRange)), color); end end end diff --git a/Base.rte/Craft/Shared/ScuttleExplosions.lua b/Base.rte/Craft/Shared/ScuttleExplosions.lua new file mode 100644 index 000000000..b167bcc15 --- /dev/null +++ b/Base.rte/Craft/Shared/ScuttleExplosions.lua @@ -0,0 +1,23 @@ +function Create(self) + self.explosionTimer = Timer(); + + self.height = ToMOSprite(self):GetSpriteHeight(); + self.width = ToMOSprite(self):GetSpriteWidth(); + + if self:NumberValueExists("ScuttleExplosionDelay") then + self.explosionDelay = self:GetNumberValue("ScuttleExplosionDelay"); + else + self.explosionDelay = 5000/math.sqrt(self.width + self.height); + end +end +function Update(self) + if self.Status > Actor.INACTIVE or self.AIMode == Actor.AIMODE_SCUTTLE then + if self.explosionTimer:IsPastSimMS(self.explosionDelay) then + self.explosionTimer:Reset(); + local explosion = CreateAEmitter("Scuttle Explosion"); + explosion.Pos = self.Pos + Vector(self.width/2 * RangeRand(-0.9, 0.9), self.height/2 * RangeRand(-0.9, 0.9)):RadRotate(self.RotAngle); + explosion.Vel = self.Vel; + MovableMan:AddParticle(explosion); + end + end +end \ No newline at end of file diff --git a/Base.rte/Craft/Shared/Turrets.ini b/Base.rte/Craft/Shared/Turrets.ini index 8df278583..4127d3895 100644 --- a/Base.rte/Craft/Shared/Turrets.ini +++ b/Base.rte/Craft/Shared/Turrets.ini @@ -1,3 +1,6 @@ +/////////////////////////////////////////////////////////////////////// +// Craft Turrets + AddEffect = AEmitter PresetName = Machine Gun Turret diff --git a/Base.rte/Craft/StorageCrate/Crate.ini b/Base.rte/Craft/StorageCrate/Crate.ini index 8df5578af..9b5ca3508 100644 --- a/Base.rte/Craft/StorageCrate/Crate.ini +++ b/Base.rte/Craft/StorageCrate/Crate.ini @@ -54,8 +54,8 @@ AddActor = ACRocket MaxMass = 600 MaxPassengers = 1 Position = Vector - X = 520 - Y = 20 + X = 0 + Y = -50 Velocity = Vector X = 0 Y = 0 @@ -71,7 +71,7 @@ AddActor = ACRocket CopyOf = Dent Metal ExitWound = AEmitter CopyOf = Dent Metal - GoldValue = 20 + GoldValue = 25 Buyable = 0 AtomGroup = AtomGroup AutoGenerate = 1 @@ -238,13 +238,13 @@ AddActor = ACRocket CopyOf = Crate PresetName = Drop Crate ScriptPath = Base.rte/Craft/StorageCrate/DropCrate.lua - Description = Quick drop from an orbiting station in a strong metal crate and amazing cushions to preserve the contents that would usually never survive an orbital drop. + Description = Quick drop from an orbiting station in a strong metal crate and amazing cushions to preserve the contents that would usually never survive an orbital drop. Organic contents may suffer from mild blunt trauma. AddToGroup = Craft - Crates Velocity = Vector X = 0 Y = 20 - GoldValue = 20 - DeliveryDelayMultiplier = 2.25 + GoldValue = 50 + DeliveryDelayMultiplier = 2.5 Buyable = 1 GibImpulseLimit = 20000 GibWoundLimit = 10 \ No newline at end of file diff --git a/Base.rte/Craft/StorageCrate/DropCrate.lua b/Base.rte/Craft/StorageCrate/DropCrate.lua index 638af2f2b..970b8e7c4 100644 --- a/Base.rte/Craft/StorageCrate/DropCrate.lua +++ b/Base.rte/Craft/StorageCrate/DropCrate.lua @@ -4,8 +4,14 @@ function Create(self) -- Choose a random horizontal direction local randomDirection = math.random() > 0.5 and 1 or -1; -- Randomize velocities - self.AngularVel = -randomDirection * math.random(1, 5); - self.Vel = Vector(randomDirection * math.random(5, 20), 30); + self.RotAngle = RangeRand(0, math.pi * 2); + self.AngularVel = -randomDirection * math.random(1, 10); + self.Pos = Vector(self.Pos.X - randomDirection * math.random(99), self.Pos.Y); + -- Try not to fly off the edge in non-wrapping scenes + if not SceneMan.SceneWrapsX then + randomDirection = self.Pos.X > (SceneMan.SceneWidth - 99) and -1 or (self.Pos.X < 99 and 1 or randomDirection); + end + self.Vel = Vector(randomDirection * math.random(1, 20), 40); end function Update(self) -- Apply damage to the actors inside based on impulse forces @@ -16,7 +22,7 @@ function Update(self) actor = ToActor(actor); -- The following method is a slightly revised version of the hardcoded impulse damage system local impulse = self.TravelImpulse.Magnitude - actor.ImpulseDamageThreshold; - local damage = impulse / (actor.GibImpulseLimit * 0.1 + actor.Material.StructuralIntegrity * 10); + local damage = impulse/(actor.GibImpulseLimit * 0.1 + actor.Material.StructuralIntegrity * 10); actor.Health = damage > 0 and actor.Health - damage or actor.Health; actor.Status = actor.Status < Actor.DYING and Actor.UNSTABLE or actor.Status; end @@ -25,8 +31,10 @@ function Update(self) end if self.GibTimer:IsPastSimTimeLimit() then self:GibThis(); - elseif self.Vel.Largest > 5 or self.AIMode == Actor.AIMODE_STAY then + elseif (self.Vel.Largest + math.abs(self.AngularVel)) > 5 or self.AIMode == Actor.AIMODE_STAY then self.GibTimer:Reset(); + else + self:OpenHatch(); end end function Destroy(self) diff --git a/Base.rte/Devices/Explosives/AntiPersonnelMine/AntiPersonnelMine.ini b/Base.rte/Devices/Explosives/AntiPersonnelMine/AntiPersonnelMine.ini index 9dd3cd5c7..5ef17bb39 100644 --- a/Base.rte/Devices/Explosives/AntiPersonnelMine/AntiPersonnelMine.ini +++ b/Base.rte/Devices/Explosives/AntiPersonnelMine/AntiPersonnelMine.ini @@ -159,7 +159,7 @@ AddEffect = MOSRotating AddDevice = TDExplosive PresetName = Anti Personnel Mine AddToGroup = Bombs - Description = A plantable mine that detonates when enemy movement interrupts its laser. Disarm with the Disarmer. This mine must be activated before it can detect enemies! + Description = A plantable explosive that detonates when enemy movement interrupts its laser. Disarm with the Disarmer. This mine must be activated before it can detect enemies! Mass = 3 RestThreshold = -500 HitsMOs = 0 @@ -191,13 +191,13 @@ AddDevice = TDExplosive DeepCheck = 0 JointStrength = 40 JointStiffness = 0.5 - DrawAfterParent = 1 + DrawAfterParent = 0 StanceOffset = Vector X = 4 Y = 4 StartThrowOffset = Vector - X = 7 - Y = 2 + X = 9 + Y = -2 EndThrowOffset = Vector X = 4 Y = 4 diff --git a/Base.rte/Devices/Explosives/AntiPersonnelMine/MineSet.lua b/Base.rte/Devices/Explosives/AntiPersonnelMine/MineSet.lua index 9cd09bc6b..a79498d61 100644 --- a/Base.rte/Devices/Explosives/AntiPersonnelMine/MineSet.lua +++ b/Base.rte/Devices/Explosives/AntiPersonnelMine/MineSet.lua @@ -17,14 +17,14 @@ function Create(self) self.Sharpness = 0; self.blink = false; - self.Frame = (self.alliedTeam+1)*2; + self.Frame = (self.alliedTeam + 1) * 2; - if coalitionMineTable == nil then - coalitionMineTable = {}; + if AntiPersonnelMineTable == nil then + AntiPersonnelMineTable = {}; end - self.tableNum = #coalitionMineTable+1; - coalitionMineTable[self.tableNum] = self; + self.tableNum = #AntiPersonnelMineTable + 1; + AntiPersonnelMineTable[self.tableNum] = self; self.checkDelay = 100; self.checkDelayExtension = 0.1; @@ -35,9 +35,9 @@ end function Update(self) self.ToSettle = false; - if coalitionMineTable == nil then - coalitionMineTable = {}; - coalitionMineTable[self.tableNum] = self; + if AntiPersonnelMineTable == nil then + AntiPersonnelMineTable = {}; + AntiPersonnelMineTable[self.tableNum] = self; end if self.Sharpness ~= 0 then self.ToDelete = true; @@ -47,25 +47,25 @@ function Update(self) local trace = Vector(self.Vel.X, self.Vel.Y):SetMagnitude(self.Radius + self.Vel.Magnitude); local rayHitPos = Vector(); - local terrainRaycast = SceneMan:CastStrengthRay(self.Pos, trace, 5, rayHitPos, 0, 0, SceneMan.SceneWrapsX); + local terrainRaycast = SceneMan:CastStrengthRay(self.Pos, trace, 5, rayHitPos, 0, rte.airID, SceneMan.SceneWrapsX); if terrainRaycast == true then trace = Vector(trace.X, trace.Y):SetMagnitude(trace.Magnitude + 5); local rayHitPosA = Vector(); - local terrainRaycastA = SceneMan:CastStrengthRay(self.Pos + Vector(0, 3):RadRotate(Vector(self.Vel.X,self.Vel.Y).AbsRadAngle), trace, 5, rayHitPosA, 0, 0, SceneMan.SceneWrapsX); + local terrainRaycastA = SceneMan:CastStrengthRay(self.Pos + Vector(0, 3):RadRotate(Vector(self.Vel.X,self.Vel.Y).AbsRadAngle), trace, 5, rayHitPosA, 0, rte.airID, SceneMan.SceneWrapsX); local rayHitPosB = Vector(); - local terrainRaycastB = SceneMan:CastStrengthRay(self.Pos + Vector(0,-3):RadRotate(Vector(self.Vel.X,self.Vel.Y).AbsRadAngle), trace, 5, rayHitPosB, 0, 0, SceneMan.SceneWrapsX); + local terrainRaycastB = SceneMan:CastStrengthRay(self.Pos + Vector(0, -3):RadRotate(Vector(self.Vel.X,self.Vel.Y).AbsRadAngle), trace, 5, rayHitPosB, 0, rte.airID, SceneMan.SceneWrapsX); if terrainRaycastA == true and terrainRaycastB == true then - self.faceDirection = SceneMan:ShortestDistance(rayHitPosA, rayHitPosB, SceneMan.SceneWrapsX).AbsRadAngle + (math.pi /2); + self.faceDirection = SceneMan:ShortestDistance(rayHitPosA, rayHitPosB, SceneMan.SceneWrapsX).AbsRadAngle + (math.pi/2); else - self.faceDirection = (self.Vel*-1).AbsRadAngle; + self.faceDirection = (self.Vel * -1).AbsRadAngle; end self.Pos = rayHitPos + SceneMan:ShortestDistance(rayHitPos,self.Pos,SceneMan.SceneWrapsX):SetMagnitude(2); - self.RotAngle = self.faceDirection-(math.pi/2); + self.RotAngle = self.faceDirection - (math.pi/2); self.PinStrength = self.GibImpulseLimit; self.actionPhase = 1; AudioMan:PlaySound("Base.rte/Devices/Explosives/AntiPersonnelMine/Sounds/MineActivate.wav", self.Pos); @@ -82,10 +82,10 @@ function Update(self) if self.blink == false then self.blink = true; - self.Frame = (self.alliedTeam+1)*2; + self.Frame = (self.alliedTeam + 1) * 2; else self.blink = false; - self.Frame = ((self.alliedTeam+1)*2)+1; + self.Frame = ((self.alliedTeam + 1) * 2) + 1; end end @@ -93,23 +93,22 @@ function Update(self) self.checkDelay = self.checkDelay + self.checkDelayExtension; self.detectionAngleTurn = self.detectionAngleTurn + math.rad(self.detectionTurnSpeed); - local detectionAngle = self.faceDirection + (math.sin(self.detectionAngleTurn) * math.rad(self.detectionAngleDegrees / 2)); + local detectionAngle = self.faceDirection + (math.sin(self.detectionAngleTurn) * math.rad(self.detectionAngleDegrees/2)); self.delayTimer:Reset(); local rayHitPos = Vector(); local startPos = self.Pos + Vector(self.Radius, 0):RadRotate(detectionAngle); - local terrainRaycast = SceneMan:CastStrengthRay(startPos, Vector(self.laserLength, 0):RadRotate(detectionAngle), 10, rayHitPos, 1, 0, SceneMan.SceneWrapsX); + local terrainRaycast = SceneMan:CastStrengthRay(startPos, Vector(self.laserLength, 0):RadRotate(detectionAngle), 10, rayHitPos, 1, rte.airID, SceneMan.SceneWrapsX); if terrainRaycast == true then self.tempLaserLength = SceneMan:ShortestDistance(startPos,rayHitPos,SceneMan.SceneWrapsX).Magnitude; else self.tempLaserLength = self.laserLength; end - local raycast = SceneMan:CastMORay(startPos,Vector(self.tempLaserLength,0):RadRotate(detectionAngle),self.ID,self.alliedTeam,0,true,4); + local raycast = SceneMan:CastMORay(startPos,Vector(self.tempLaserLength, 0):RadRotate(detectionAngle), self.ID, self.alliedTeam, rte.airID, true, 4); if raycast ~= rte.NoMOID then - local targetpart = ToMOSRotating(MovableMan:GetMOFromID(raycast)); - local target = ToMOSRotating(MovableMan:GetMOFromID(targetpart.RootID)); + local target = ToMOSRotating(MovableMan:GetMOFromID(raycast)):GetRootParent(); if not (target.Team == self.alliedTeam and IsActor(target)) and (target.Vel.Magnitude * (1 + math.abs(target.AngularVel) + math.sqrt(target.Radius))) > self.detonateThreshold then self.actionPhase = 2; self.blink = false; @@ -126,7 +125,7 @@ function Update(self) if self.blink == false then self.blink = true; - self.Frame = ((self.alliedTeam+1)*2)+1; + self.Frame = ((self.alliedTeam + 1) * 2) + 1; self.delayTimer:Reset(); AudioMan:PlaySound("Base.rte/Devices/Explosives/AntiPersonnelMine/Sounds/MineDetonate.wav", self.Pos); end @@ -137,5 +136,5 @@ function Update(self) end end function Destroy(self) - coalitionMineTable[self.tableNum] = nil; + AntiPersonnelMineTable[self.tableNum] = nil; end \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.ini b/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.ini index cfdbb6488..084c756b4 100644 --- a/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.ini +++ b/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.ini @@ -94,11 +94,11 @@ AddDevice = TDExplosive AddToGroup = Bombs AddToGroup = Bombs - Payloads Description = Mine field deployment bomb. ONLY for dropship use. Scatter mines across the battlefield to stop enemy advances! Explodes several meters above the ground to assure maximum coverage. - Mass = 20 + Mass = 30 OrientToVel = 0.8 RestThreshold = -500 HitsMOs = 1 - GetsHitByMOs = 0 + GetsHitByMOs = 1 ScriptPath = Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.lua SpriteFile = ContentFile FilePath = Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.bmp @@ -126,7 +126,7 @@ AddDevice = TDExplosive DeepCheck = 0 JointStrength = 40 JointStiffness = 0.5 - DrawAfterParent = 1 + DrawAfterParent = 0 DetonationSound = SoundContainer AttenuationStartDistance = 200 AddSound = ContentFile @@ -135,13 +135,13 @@ AddDevice = TDExplosive X = 4 Y = 4 StartThrowOffset = Vector - X = 5 - Y = 1 + X = 6 + Y = -7 EndThrowOffset = Vector X = 4 Y = 4 MinThrowVel = 1 - MaxThrowVel = 10 + MaxThrowVel = 8 TriggerDelay = 5000 ActivatesWhenReleased = 1 AddGib = Gib @@ -170,5 +170,5 @@ AddDevice = TDExplosive MinVelocity = 30 LifeVariation = 0.50 InheritsVel = 0 - GibImpulseLimit = 10 - GibWoundLimit = 8 \ No newline at end of file + GibImpulseLimit = 20 + GibWoundLimit = 5 \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.lua b/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.lua index 51c51b438..93e7ae0be 100644 --- a/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.lua +++ b/Base.rte/Devices/Explosives/ClusterMineBomb/ClusterMineBomb.lua @@ -2,7 +2,7 @@ function Create(self) self.alliedTeam = -1; self.lastAngle = self.RotAngle; - self.lastVel = Vector(self.Vel.X,self.Vel.Y); + self.lastVel = Vector(self.Vel.X, self.Vel.Y); self.deployRange = 100; @@ -12,31 +12,33 @@ end function Update(self) self.lastAngle = self.RotAngle; - self.lastVel = Vector(self.Vel.X,self.Vel.Y); + self.lastVel = Vector(self.Vel.X, self.Vel.Y); - if self.ID == self.RootID and self.alliedTeam == -1 then - self.curdist = 500; - for actor in MovableMan.Actors do - local dist = SceneMan:ShortestDistance(self.Pos,actor.Pos,SceneMan.SceneWrapsX).Magnitude; - if dist < self.curdist then - self.curdist = dist; - self.alliedTeam = ToActor(actor).Team; + if not self:GetParent() then + if self.alliedTeam == -1 then + self.curdist = 500; + for actor in MovableMan.Actors do + local dist = SceneMan:ShortestDistance(self.Pos, actor.Pos, SceneMan.SceneWrapsX).Magnitude - actor.Radius; + if dist < self.curdist then + self.curdist = dist; + self.alliedTeam = ToActor(actor).Team; + end end end - end - local rayHitPos = Vector(); - local terrainRaycast = SceneMan:CastStrengthRay(self.Pos, Vector(self.Vel.X,self.Vel.Y):SetMagnitude(self.Radius + self.deployRange + self.Vel.Magnitude),0,rayHitPos,0,0,SceneMan.SceneWrapsX); + local rayHitPos = Vector(); + local terrainRaycast = SceneMan:CastStrengthRay(self.Pos, Vector(self.Vel.X, self.Vel.Y):SetMagnitude(self.Radius + self.deployRange + self.Vel.Magnitude), 0, rayHitPos, 1, rte.airID, SceneMan.SceneWrapsX); - if terrainRaycast == true then - local spread = 3; - for i = 1, self.mineCount do - local mine = CreateMOSRotating("Anti Personnel Mine Active"); - mine.Pos = self.Pos; - mine.Vel = self.Vel /2 + Vector(self.Vel.X, self.Vel.Y):RadRotate(spread * 0.6 - (spread * (i / self.mineCount)) + RangeRand(-0.1, 0.1)):SetMagnitude(20); - mine.Sharpness = self.alliedTeam; - MovableMan:AddParticle(mine); - self:GibThis(); + if terrainRaycast == true then + local spread = 3; + for i = 1, self.mineCount do + local mine = CreateMOSRotating("Anti Personnel Mine Active"); + mine.Pos = self.Pos; + mine.Vel = self.Vel/2 + Vector(self.Vel.X, self.Vel.Y):RadRotate(spread * 0.6 - (spread * (i/self.mineCount)) + RangeRand(-0.1, 0.1)):SetMagnitude(20); + mine.Sharpness = self.alliedTeam; + MovableMan:AddParticle(mine); + self:GibThis(); + end end end end @@ -50,17 +52,16 @@ function Destroy(self) MovableMan:AddParticle(gibA); local gibB = CreateMOSRotating("Cluster Mine Bomb Gib B"); - gibB.Pos = self.Pos + Vector(1,-3):RadRotate(self.lastAngle); - gibB.Vel = self.Vel + Vector(0,20):RadRotate(self.lastAngle); + gibB.Pos = self.Pos + Vector(1, -3):RadRotate(self.lastAngle); + gibB.Vel = self.Vel + Vector(0, 20):RadRotate(self.lastAngle); gibB.AngularVel = 10; gibB.RotAngle = self.lastAngle; MovableMan:AddParticle(gibB); local gibC = CreateMOSRotating("Cluster Mine Bomb Gib C"); - gibC.Pos = self.Pos + Vector(1,3):RadRotate(self.lastAngle); - gibC.Vel = self.Vel + Vector(0,-20):RadRotate(self.lastAngle); + gibC.Pos = self.Pos + Vector(1, 3):RadRotate(self.lastAngle); + gibC.Vel = self.Vel + Vector(0, -20):RadRotate(self.lastAngle); gibC.AngularVel = -10; gibC.RotAngle = self.lastAngle; MovableMan:AddParticle(gibC); - end \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini b/Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini index f783ab21a..4f5d907d9 100644 --- a/Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini +++ b/Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.ini @@ -130,11 +130,11 @@ AddDevice = TDExplosive AddToGroup = Bombs AddToGroup = Bombs - Payloads Description = Napalm craft-bombardment bomb. ONLY for dropship use. Rain flaming death upon troopers by cooking them with hot napalm ordnance! - Mass = 20 + Mass = 30 OrientToVel = 0.8 RestThreshold = -500 HitsMOs = 1 - GetsHitByMOs = 0 + GetsHitByMOs = 1 SpriteFile = ContentFile FilePath = Base.rte/Devices/Explosives/NapalmBomb/NapalmBomb.bmp FrameCount = 1 @@ -161,7 +161,7 @@ AddDevice = TDExplosive DeepCheck = 0 JointStrength = 40 JointStiffness = 0.5 - DrawAfterParent = 1 + DrawAfterParent = 0 DetonationSound = SoundContainer CopyOf = Crash Woosh AttenuationStartDistance = 240 @@ -169,13 +169,13 @@ AddDevice = TDExplosive X = 4 Y = 4 StartThrowOffset = Vector - X = 5 - Y = 1 + X = 6 + Y = -7 EndThrowOffset = Vector X = 4 Y = 4 MinThrowVel = 1 - MaxThrowVel = 10 + MaxThrowVel = 8 TriggerDelay = 5000 ActivatesWhenReleased = 1 AddGib = Gib @@ -294,5 +294,5 @@ AddDevice = TDExplosive MaxVelocity = 50 LifeVariation = 0.20 InheritsVel = 0 - GibImpulseLimit = 10 - GibWoundLimit = 8 \ No newline at end of file + GibImpulseLimit = 20 + GibWoundLimit = 4 \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini index a478c8295..c77455749 100644 --- a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini +++ b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosive.ini @@ -29,15 +29,6 @@ AddEffect = AEmitter // Remote Explosive Detonator -AddAmmo = Round - PresetName = Round Detonator - ParticleCount = 1 - Particle = MOPixel - CopyOf = Null Bullet - Shell = None - FireVelocity = 1 - - AddAmmo = Magazine PresetName = Magazine Detonator Mass = 0 @@ -52,7 +43,7 @@ AddAmmo = Magazine Stiffness = 1 RoundCount = -1 RegularRound = Round - CopyOf = Round Detonator + CopyOf = Null Round AddDevice = HDFirearm @@ -60,7 +51,7 @@ AddDevice = HDFirearm AddToGroup = Tools AddToGroup = Bombs Description = Detonates all Remote Explosives that have been placed by your team. - Mass = 3 + Mass = 1.5 HitsMOs = 0 GetsHitByMOs = 1 ScriptPath = Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua @@ -74,17 +65,17 @@ AddDevice = HDFirearm CopyOf = Dent Metal ExitWound = AEmitter CopyOf = Dent Metal - GoldValue = 25 + GoldValue = 10 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Metal + CopyOf = Military Stuff Resolution = 4 Depth = 0 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Metal + CopyOf = Military Stuff Resolution = 4 Depth = 10 DeepCheck = 0 @@ -92,45 +83,27 @@ AddDevice = HDFirearm Stiffness = 0.3 JointOffset = Vector X = -2 - Y = -3 + Y = -1 DrawAfterParent = 0 OneHanded = 0 StanceOffset = Vector - X = 6 - Y = 4 + X = 8 + Y = 5 SharpStanceOffset = Vector - X = 9 - Y = -4 + X = 7 + Y = 1 SupportOffset = Vector - X = 3 - Y = 2 + X = 99 + Y = 99 SharpLength = 0 Magazine = Magazine CopyOf = Magazine Detonator ParentOffset = Vector X = -2 Y = 1 - Flash = None -// FireSound = SoundContainer -// AddSound = ContentFile -// FilePath = Base.rte/Devices/Explosives/RemoteExplosive/Sounds/RemoteExplosiveDetonate.wav - RateOfFire = 200 - ReloadTime = 0 - FullAuto = 0 - FireIgnoresThis = 0 - ShakeRange = 0 - SharpShakeRange = 0 - NoSupportFactor = 0 - ParticleSpreadRange = 0 - ShellSpreadRange = 0 - ShellAngVelRange = 0 - MuzzleOffset = Vector - X = 0 - Y = 0 - EjectionOffset = Vector - X = 0 - Y = 0 - GibWoundLimit = 2 + RateOfFire = 60 + ReloadTime = 400 + GibWoundLimit = 3 /////////////////////////////////////////////////////////////////////// @@ -174,43 +147,44 @@ AddMOSRotating = MOSRotating AddGib = Gib GibParticle = MOPixel CopyOf = Glow Explosion Huge - Spread = 2.25 - MaxVelocity = 0.1 - MinVelocity = 0 - InheritsVel = 0 + Spread = 3.14 + MaxVelocity = 1 + MinVelocity = 1 AddGib = Gib GibParticle = MOSParticle CopyOf = Main Thruster Blast Ball 1 Glow - Count = 10 + Count = 25 + Spread = 3.14 MaxVelocity = 20 - MinVelocity = 10 + MinVelocity = 5 LifeVariation = 0.30 InheritsVel = 0 AddGib = Gib GibParticle = MOPixel CopyOf = Grenade Fragment Gray - Count = 20 + Count = 25 Spread = 3.14 - MaxVelocity = 75 - MinVelocity = 50 + MaxVelocity = 80 + MinVelocity = 60 InheritsVel = 0 AddGib = Gib GibParticle = MOPixel CopyOf = Grenade Fragment Yellow PresetName = Remote Explosive Door Buster LifeTime = 10 - Count = 60 - Spread = 3.1 + Count = 150 + Spread = 3.14 MinVelocity = 100 - MaxVelocity = 150 + MaxVelocity = 200 InheritsVel = 0 - AddGib = Gib +/* AddGib = Gib GibParticle = MOPixel CopyOf = Air Blast Count = 100 + Spread = 3.14 MinVelocity = 100 MaxVelocity = 100 - InheritsVel = 0 + InheritsVel = 0 */ AddGib = Gib GibParticle = MOPixel CopyOf = Air Blast Scripted @@ -223,45 +197,27 @@ AddMOSRotating = MOSRotating AddGib = Gib GibParticle = MOSParticle CopyOf = Grenade Smoke 1 - Count = 30 + Count = 35 Spread = 3.14 - MaxVelocity = 120 - MinVelocity = 60 + MaxVelocity = 100 + MinVelocity = 25 LifeVariation = 0.50 InheritsVel = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Grenade Smoke 2 - Count = 30 + Count = 35 Spread = 3.14 - MaxVelocity = 120 - MinVelocity = 60 - LifeVariation = 0.50 - InheritsVel = 0 - AddGib = Gib - GibParticle = MOSParticle - CopyOf = Explosion Smoke 1 - Count = 15 - Spread = 3.1 - MaxVelocity = 20 - MinVelocity = 0 - LifeVariation = 0.50 - InheritsVel = 0 - AddGib = Gib - GibParticle = MOSParticle - CopyOf = Explosion Smoke 2 - Count = 15 - Spread = 3.1 - MaxVelocity = 15 - MinVelocity = 0 + MaxVelocity = 100 + MinVelocity = 25 LifeVariation = 0.50 InheritsVel = 0 - + AddDevice = TDExplosive PresetName = Remote Explosive AddToGroup = Bombs - Description = Manually placed C4 explosives that are automatically set to operate on your team's frequency. Detonate using the Detonator tool. + Description = Manually placed C4 explosives that are automatically set to operate on your team's frequency. Mass = 3 HitsMOs = 1 GetsHitByMOs = 1 diff --git a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDeploy.lua b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDeploy.lua index 07894d1d0..61332da83 100644 --- a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDeploy.lua +++ b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDeploy.lua @@ -5,15 +5,11 @@ function Create(self) end function Update(self) - - if self.ID ~= self.RootID then - local actor = MovableMan:GetMOFromID(self.RootID); - if MovableMan:IsActor(actor) then - self.alliedTeam = ToActor(actor).Team; - end - end - - if self:IsActivated() and self.ID == self.RootID then + local parent = self:GetRootParent(); + if parent and IsAHuman(parent) then + self.alliedTeam = ToAHuman(parent).Team; + self.user = ToAHuman(parent); + elseif self:IsActivated() then local explosive = CreateMOSRotating("Remote Explosive Active"); explosive.Pos = self.Pos; @@ -21,9 +17,17 @@ function Update(self) explosive.RotAngle = self.RotAngle; explosive.Sharpness = self.alliedTeam; MovableMan:AddParticle(explosive); - + + if self.user and IsAHuman(self.user) then + if not self.user:HasObject("Detonator") then + self.user:AddInventoryItem(CreateHDFirearm("Base.rte/Detonator")); + end + if not self.user:EquipNamedDevice(self.PresetName, true) then + self.user:EquipNamedDevice("Detonator", true); + end + end self.ToDelete = true; - + else + self.user = nil; end - end \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua index 05282e350..50104c48a 100644 --- a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua +++ b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveDetonator.lua @@ -16,35 +16,35 @@ function Update(self) self.alliedTeam = ToActor(actor).Team; end end + if self.Magazine then + if self:IsActivated() then + if self.fireOn == false then + self.Magazine.RoundCount = 500 - self.overallTimer.ElapsedSimTimeMS; + if self.delayTimer:IsPastSimMS(500) then + self.delayTimer:Reset(); + self.actionPhase = self.actionPhase + 1; + self.blink = false; + end + if self.actionPhase >= 1 then - if self:IsActivated() then - - if self.fireOn == false then - self.Magazine.RoundCount = 500-self.overallTimer.ElapsedSimTimeMS; - if self.delayTimer:IsPastSimMS(500) then - self.delayTimer:Reset(); - self.actionPhase = self.actionPhase + 1; - self.blink = false; - end - if self.actionPhase >= 1 then - - if coalitionC4TableA ~= nil and coalitionC4TableB ~= nil then - for i = 1, #coalitionC4TableA do - if MovableMan:IsParticle(coalitionC4TableA[i]) and coalitionC4TableB[i] == self.alliedTeam then - coalitionC4TableA[i].Sharpness = 2; + if RemoteExplosiveTableA and RemoteExplosiveTableB then + for i = 1, #RemoteExplosiveTableA do + if MovableMan:IsParticle(RemoteExplosiveTableA[i]) and RemoteExplosiveTableB[i] == self.alliedTeam then + RemoteExplosiveTableA[i].Sharpness = 2; + end end end + AudioMan:PlaySound("Base.rte/Devices/Explosives/AntiPersonnelMine/Sounds/MineDetonate.wav", self.Pos); + self.fireOn = true; + self:Reload(); end - AudioMan:PlaySound("Base.rte/Devices/Explosives/AntiPersonnelMine/Sounds/MineDetonate.wav", self.Pos); - self.fireOn = true; end + else + self.delayTimer:Reset(); + self.overallTimer:Reset(); + self.Magazine.RoundCount = 500; + self.fireOn = false; + self.actionPhase = 0; end - else - self.delayTimer:Reset(); - self.overallTimer:Reset(); - self.Magazine.RoundCount = 500; - self.fireOn = false; - self.actionPhase = 0; end - end \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveSet.lua b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveSet.lua index 0b52e1cd8..1d83cba38 100644 --- a/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveSet.lua +++ b/Base.rte/Devices/Explosives/RemoteExplosive/RemoteExplosiveSet.lua @@ -10,14 +10,14 @@ function Create(self) self.Team = self.alliedTeam; self.Sharpness = 0; - if coalitionC4TableA == nil then - coalitionC4TableA = {}; - coalitionC4TableB = {}; + if RemoteExplosiveTableA == nil then + RemoteExplosiveTableA = {}; + RemoteExplosiveTableB = {}; end - self.tableNum = #coalitionC4TableA+1; - coalitionC4TableA[self.tableNum] = self; - coalitionC4TableB[self.tableNum] = self.alliedTeam; + self.tableNum = #RemoteExplosiveTableA + 1; + RemoteExplosiveTableA[self.tableNum] = self; + RemoteExplosiveTableB[self.tableNum] = self.alliedTeam; self.breachStrength = 100; end @@ -98,6 +98,6 @@ function Update(self) end end function Destroy(self) - coalitionC4TableA[self.tableNum] = nil; - coalitionC4TableB[self.tableNum] = nil; + RemoteExplosiveTableA[self.tableNum] = nil; + RemoteExplosiveTableB[self.tableNum] = nil; end \ No newline at end of file diff --git a/Base.rte/Devices/Explosives/StandardBomb/StandardBomb.ini b/Base.rte/Devices/Explosives/StandardBomb/StandardBomb.ini index 761ecb80b..640b1bd95 100644 --- a/Base.rte/Devices/Explosives/StandardBomb/StandardBomb.ini +++ b/Base.rte/Devices/Explosives/StandardBomb/StandardBomb.ini @@ -7,11 +7,11 @@ AddDevice = TDExplosive AddToGroup = Bombs AddToGroup = Bombs - Payloads Description = Normal craft-bombardment bomb. ONLY for dropship use. Fly high above before dropping these so you won't hit yourself with your own payload! - Mass = 10 + Mass = 20 OrientToVel = 0.8 RestThreshold = -500 HitsMOs = 1 - GetsHitByMOs = 0 + GetsHitByMOs = 1 SpriteFile = ContentFile FilePath = Base.rte/Devices/Explosives/StandardBomb/StandardBomb.bmp FrameCount = 1 @@ -38,7 +38,7 @@ AddDevice = TDExplosive DeepCheck = 0 JointStrength = 40 JointStiffness = 0.5 - DrawAfterParent = 1 + DrawAfterParent = 0 DetonationSound = SoundContainer AttenuationStartDistance = 240 AddSound = ContentFile @@ -52,7 +52,7 @@ AddDevice = TDExplosive Y = 4 StartThrowOffset = Vector X = 5 - Y = 1 + Y = -8 EndThrowOffset = Vector X = 4 Y = 4 @@ -133,5 +133,5 @@ AddDevice = TDExplosive MinVelocity = 40 MaxVelocity = 40 InheritsVel = 0 - GibImpulseLimit = 10 - GibWoundLimit = 5 \ No newline at end of file + GibImpulseLimit = 20 + GibWoundLimit = 3 \ No newline at end of file diff --git a/Base.rte/Devices/Shared.ini b/Base.rte/Devices/Shared.ini index 7319b9a40..0e64879b4 100644 --- a/Base.rte/Devices/Shared.ini +++ b/Base.rte/Devices/Shared.ini @@ -50,6 +50,12 @@ AddAmmo = Magazine Discardable = 0 +AddAmmo = Magazine + CopyOf = Null Magazine + PresetName = Null Magazine Infinite + RoundCount = -1 + + /////////////////////////////////////////////////////////////////////// // Ammo @@ -76,7 +82,7 @@ AddAmmo = Round R = 155 G = 155 B = 155 - TrailLength = 25 + TrailLength = 30 Shell = MOSParticle CopyOf = Casing FireVelocity = 110 diff --git a/Base.rte/Devices/Shared/Scripts/AutoReload.lua b/Base.rte/Devices/Shared/Scripts/AutoReload.lua index 8f857bde2..13b5fe5ce 100644 --- a/Base.rte/Devices/Shared/Scripts/AutoReload.lua +++ b/Base.rte/Devices/Shared/Scripts/AutoReload.lua @@ -1,8 +1,8 @@ function Update(self) - if not (self.Magazine) or (self.Magazine and self.Magazine.RoundCount == 0) then + if self.RoundInMagCount == 0 then local actor = MovableMan:GetMOFromID(self.RootID); if MovableMan:IsActor(actor) then - ToActor(actor):GetController():SetState(Controller.WEAPON_RELOAD,true); + self:Reload(); end end end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/BurstFire.lua b/Base.rte/Devices/Shared/Scripts/BurstFire.lua index 013abe14b..cbcf95bae 100644 --- a/Base.rte/Devices/Shared/Scripts/BurstFire.lua +++ b/Base.rte/Devices/Shared/Scripts/BurstFire.lua @@ -1,17 +1,23 @@ function Create(self) self.shotsPerBurst = 3; - self.coolDownDelay = (60000 / self.RateOfFire); + self.coolDownDelay = (60000/self.RateOfFire) + 60; end function Update(self) if self.Magazine then if self.coolDownTimer then - local parent = self:GetRootParent(); - if self.coolDownTimer:IsPastSimMS(self.coolDownDelay) and parent and IsActor(parent) and not (self:IsActivated() and ToActor(parent):IsPlayerControlled()) then + if self.coolDownTimer:IsPastSimMS(self.coolDownDelay) and not (self:IsActivated() and self.triggerPulled) then self.coolDownTimer, self.shotCounter = nil; else self:Deactivate(); + local parent = self:GetRootParent(); + if parent and IsActor(parent) and not ToActor(parent):IsPlayerControlled() then + self.triggerPulled = false; + end end elseif self.shotCounter then + + self.triggerPulled = self:IsActivated(); + self:Activate(); if self.FiredFrame then self.shotCounter = self.shotCounter + 1; diff --git a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeHigh.lua b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeHigh.lua index af4a526bf..fedde3c4d 100644 --- a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeHigh.lua +++ b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeHigh.lua @@ -1,6 +1,6 @@ function Create(self) local Effect - local Offset = self.Vel*(20*TimerMan.DeltaTimeSecs) -- the effect will be created the next frame so move it one frame backwards towards the barrel + local Offset = self.Vel * rte.PxTravelledPerFrame -- The effect will be created the next frame so move it one frame backwards towards the barrel for i = 1, 2 do Effect = CreateMOSParticle("Tiny Smoke Ball 1", "Base.rte") diff --git a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeLow.lua b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeLow.lua index 640587c3a..9bf7210dc 100644 --- a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeLow.lua +++ b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeLow.lua @@ -1,31 +1,17 @@ function Create(self) - if self.Magazine then - self.ammo = self.Magazine.RoundCount - else - self.ammo = 0 - end + self.minSmokeCount = 1; + self.maxSmokeCount = 3; + self.smokeSpread = math.rad(self.ParticleSpreadRange) + 0.1; end - function Update(self) - if self.Magazine then - if self.ammo > self.Magazine.RoundCount then - - local checkFlip = 1; - if self.HFlipped then - checkFlip = -1; - end - - local randomSmoke = math.floor(math.random()*3)+1; - - for i = 1, randomSmoke do - local smokefx = CreateMOSParticle("Tiny Smoke Ball 1"); - smokefx.Pos = self.MuzzlePos; - smokefx.Vel = Vector(2*checkFlip,0):RadRotate(self.RotAngle+(math.random()*0.2)-0.1); - MovableMan:AddParticle(smokefx); - smokefx = nil; - end + if self.FiredFrame then + local smokeCount = math.random(self.minSmokeCount, self.maxSmokeCount); + for i = 1, smokeCount do + local smokefx = CreateMOSParticle("Tiny Smoke Ball 1"); + smokefx.Pos = self.MuzzlePos; + smokefx.Vel = Vector(i * self.FlipFactor, 0):RadRotate(self.RotAngle + (math.random() * self.smokeSpread) - (self.smokeSpread/2)); + MovableMan:AddParticle(smokefx); end - self.ammo = self.Magazine.RoundCount end -end +end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeMedium.lua b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeMedium.lua index 6b0bb0c12..ccf6b407c 100644 --- a/Base.rte/Devices/Shared/Scripts/MuzzleSmokeMedium.lua +++ b/Base.rte/Devices/Shared/Scripts/MuzzleSmokeMedium.lua @@ -1,31 +1,17 @@ function Create(self) - if self.Magazine then - self.ammo = self.Magazine.RoundCount - else - self.ammo = 0 - end + self.minSmokeCount = 3; + self.maxSmokeCount = 6; + self.spread = 0.6; end - function Update(self) - if self.Magazine then - if self.ammo > self.Magazine.RoundCount then - - local checkFlip = 1; - if self.HFlipped then - checkFlip = -1; - end - - local randomSmoke = math.floor(math.random()*3)+3; - - for i = 1, randomSmoke do - local smokefx = CreateMOSParticle("Tiny Smoke Ball 1"); - smokefx.Pos = self.MuzzlePos; - smokefx.Vel = Vector(((math.random()*4)+1)*checkFlip,0):RadRotate(self.RotAngle+(math.random()*0.6)-0.3); - MovableMan:AddParticle(smokefx); - smokefx = nil; - end + if self.FiredFrame then + local smokeCount = math.random(self.minSmokeCount, self.maxSmokeCount); + for i = 1, smokeCount do + local smokefx = CreateMOSParticle("Tiny Smoke Ball 1"); + smokefx.Pos = self.MuzzlePos; + smokefx.Vel = Vector(i * self.FlipFactor, 0):RadRotate(self.RotAngle + (math.random() * self.spread) - (self.spread/2)); + MovableMan:AddParticle(smokefx); end - self.ammo = self.Magazine.RoundCount end -end +end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/RecoilTilt.lua b/Base.rte/Devices/Shared/Scripts/RecoilTilt.lua index 86ac4d4d4..5178c4255 100644 --- a/Base.rte/Devices/Shared/Scripts/RecoilTilt.lua +++ b/Base.rte/Devices/Shared/Scripts/RecoilTilt.lua @@ -1,18 +1,18 @@ function Create(self) - self.setAngle = 0; - self.tilt = 0.5 / math.sqrt(self.Radius); + self.setRecoilAngle = 0; + self.recoilTilt = 1/math.sqrt(self.Radius); end function Update(self) - if self.setAngle > 0 then - self.setAngle = self.setAngle - (0.001 * (10 + math.sqrt(self.RateOfFire) * self.setAngle)); - if self.setAngle < 0 then - self.setAngle = 0; + if self.setRecoilAngle > 0 then + self.setRecoilAngle = self.setRecoilAngle - (0.003 * (10 + math.sqrt(self.RateOfFire) * self.setRecoilAngle)); + if self.setRecoilAngle < 0 then + self.setRecoilAngle = 0; end end if self.FiredFrame then - self.setAngle = self.setAngle + self.tilt * math.random(); + self.setRecoilAngle = self.setRecoilAngle + (self.recoilTilt * RangeRand(0.1, 1))/(1 + self.setRecoilAngle); end - self.RotAngle = self.RotAngle + self.setAngle * self.FlipFactor; + self.RotAngle = self.RotAngle + (self.setRecoilAngle * self.FlipFactor); local jointOffset = Vector(self.JointOffset.X * self.FlipFactor, self.JointOffset.Y):RadRotate(self.RotAngle); - self.Pos = self.Pos - jointOffset + Vector(jointOffset.X, jointOffset.Y):RadRotate(-self.setAngle * self.FlipFactor); + self.Pos = self.Pos - jointOffset + Vector(jointOffset.X, jointOffset.Y):RadRotate(-self.setRecoilAngle * self.FlipFactor); end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/RevolverCylinderReload.lua b/Base.rte/Devices/Shared/Scripts/RevolverCylinderReload.lua index 7652bf7f1..eec585d75 100644 --- a/Base.rte/Devices/Shared/Scripts/RevolverCylinderReload.lua +++ b/Base.rte/Devices/Shared/Scripts/RevolverCylinderReload.lua @@ -1,25 +1,16 @@ function Create(self) - self.shellsToEject = self.Magazine.Capacity; - self.ejectedShell = false; + self.shellsToEject = self.RoundInMagCount; end - function Update(self) if self.Magazine ~= nil then - self.ejectedShell = false; - else - if self.ejectedShell == false then - self.ejectedShell = true; - if self.HFlipped == false then - self.negativeNum = 1; - else - self.negativeNum = -1; - end - for i = 1, self.shellsToEject do - local shell = CreateMOSParticle("Casing", "Base.rte"); - shell.Pos = self.Pos; - shell.Vel = Vector(math.random() * (-3) * self.negativeNum, 0):RadRotate(self.RotAngle):DegRotate((math.random() * 32) - 16); - MovableMan:AddParticle(shell); - end + self.shellsToEject = self.Magazine.Capacity - self.Magazine.RoundCount; + elseif self.shellsToEject > 0 then + for i = 1, self.shellsToEject do + local shell = CreateMOSParticle("Casing", "Base.rte"); + shell.Pos = self.Pos; + shell.Vel = Vector(math.random() * (-3) * self.FlipFactor, 0):RadRotate(self.RotAngle):DegRotate((math.random() * 32) - 16); + MovableMan:AddParticle(shell); end + self.shellsToEject = 0; end end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/ShotgunReload.lua b/Base.rte/Devices/Shared/Scripts/ShotgunReload.lua index 20c3ac454..303e93495 100644 --- a/Base.rte/Devices/Shared/Scripts/ShotgunReload.lua +++ b/Base.rte/Devices/Shared/Scripts/ShotgunReload.lua @@ -3,40 +3,31 @@ function Create(self) self.loadedShell = false; self.reloadCycle = false; - self.reloadDelay = 100; + self.reloadDelay = 75; - if self.Magazine then - self.ammoCounter = self.Magazine.RoundCount; - else - self.ammoCounter = 0; - end + self.ammoCounter = self.RoundInMagCount; end - function Update(self) - - if self.Magazine ~= nil then - if self.loadedShell == false then - self.ammoCounter = self.Magazine.RoundCount; - else + if self.Magazine then + if self.loadedShell then self.loadedShell = false; self.Magazine.RoundCount = self.ammoCounter + 1; + else + self.ammoCounter = self.Magazine.RoundCount; end else self.reloadTimer:Reset(); self.reloadCycle = true; self.loadedShell = true; end - if self:IsActivated() then self.reloadCycle = false; end - - if self.reloadCycle == true and self.reloadTimer:IsPastSimMS(self.reloadDelay) and self:IsFull() == false then + if self.reloadCycle and self.reloadTimer:IsPastSimMS(self.reloadDelay) and self:IsFull() == false then local actor = MovableMan:GetMOFromID(self.RootID); if MovableMan:IsActor(actor) then - ToActor(actor):GetController():SetState(Controller.WEAPON_RELOAD,true); + self:Reload(); end self.reloadCycle = false; end - end \ No newline at end of file diff --git a/Base.rte/Devices/Shared/Scripts/TrajectoryGuide.lua b/Base.rte/Devices/Shared/Scripts/TrajectoryGuide.lua index 93f517226..f78adaf81 100644 --- a/Base.rte/Devices/Shared/Scripts/TrajectoryGuide.lua +++ b/Base.rte/Devices/Shared/Scripts/TrajectoryGuide.lua @@ -1,47 +1,42 @@ function Create(self) self.laserTimer = Timer(); + self.laserTimer:SetSimTimeLimitMS(25); self.guideTable = {}; self.projectileVel = 30; - if self.Magazine ~= null and self.Magazine.RoundCount ~= 0 then + if self.Magazine and self.Magazine.RoundCount ~= 0 then self.projectileVel = self.Magazine.NextRound.FireVel; + self.projectileGravity = self.Magazine.NextRound.NextParticle.GlobalAccScalar; end self.maxTrajectoryPars = 60; + self.guideColor = 120; end function Update(self) local actor = MovableMan:GetMOFromID(self.RootID); if MovableMan:IsActor(actor) and ToActor(actor):IsPlayerControlled() and ToActor(actor):GetController():IsState(Controller.AIM_SHARP) then - if self.laserTimer:IsPastSimMS(25) then + if self.laserTimer:IsPastSimTimeLimit() then self.laserTimer:Reset(); self.guideTable = {}; - self.guideTable[1] = Vector(self.MuzzlePos.X,self.MuzzlePos.Y); + self.guideTable[1] = Vector(self.MuzzlePos.X, self.MuzzlePos.Y); local actor = ToActor(actor); local guideParPos = self.MuzzlePos; - local guideParVel = Vector(self.projectileVel,0):RadRotate(actor:GetAimAngle(true)); + local guideParVel = Vector(self.projectileVel, 0):RadRotate(actor:GetAimAngle(true)); for i = 1, self.maxTrajectoryPars do - guideParVel = guideParVel + Vector((SceneMan.GlobalAcc.X/GetPPM()),(SceneMan.GlobalAcc.Y/GetPPM())); + guideParVel = guideParVel + Vector((SceneMan.GlobalAcc.X/GetPPM()), (SceneMan.GlobalAcc.Y/GetPPM())) * self.projectileGravity; guideParPos = guideParPos + guideParVel; - -- No need to wrap the seam manually, primitives can handle out-of-scene coordinates correctly - --if SceneMan.SceneWrapsX == true then - -- if guideParPos.X > SceneMan.SceneWidth then - -- guideParPos = Vector(guideParPos.X - SceneMan.SceneWidth,guideParPos.Y); - -- elseif guideParPos.X < 0 then - -- guideParPos = Vector(SceneMan.SceneWidth + guideParPos.X,guideParPos.Y); - -- end - --end if SceneMan:GetTerrMatter(guideParPos.X,guideParPos.Y) == 0 then - self.guideTable[#self.guideTable+1] = guideParPos; + self.guideTable[#self.guideTable + 1] = guideParPos; else local hitPos = Vector(self.guideTable[#self.guideTable].X,self.guideTable[#self.guideTable].Y); - SceneMan:CastStrengthRay(self.guideTable[#self.guideTable],SceneMan:ShortestDistance(self.guideTable[#self.guideTable],guideParPos,false),0,hitPos,3,0,false); - self.guideTable[#self.guideTable+1] = hitPos; + SceneMan:CastStrengthRay(self.guideTable[#self.guideTable], SceneMan:ShortestDistance(self.guideTable[#self.guideTable], guideParPos,false), 0, hitPos, 3, 0, false); + self.guideTable[#self.guideTable + 1] = hitPos; break; end end @@ -52,9 +47,13 @@ function Update(self) if #self.guideTable > 1 then for i = 1, #self.guideTable-1 do - PrimitiveMan:DrawLinePrimitive(self.guideTable[i],self.guideTable[i+1],120); + PrimitiveMan:DrawLinePrimitive(self.guideTable[i],self.guideTable[i+1], self.guideColor); end - PrimitiveMan:DrawCirclePrimitive(self.guideTable[#self.guideTable],12,120); + PrimitiveMan:DrawCirclePrimitive(self.guideTable[#self.guideTable], 12, self.guideColor); end + if self:DoneReloading() and self.Magazine and self.Magazine.RoundCount ~= 0 then + self.projectileVel = self.Magazine.NextRound.FireVel; + self.projectileGravity = self.Magazine.NextRound.NextParticle.GlobalAccScalar; + end end \ No newline at end of file diff --git a/Base.rte/Devices/Shields/RiotShield/RiotShield.ini b/Base.rte/Devices/Shields/RiotShield/RiotShield.ini index 9d239f836..41bf85964 100644 --- a/Base.rte/Devices/Shields/RiotShield/RiotShield.ini +++ b/Base.rte/Devices/Shields/RiotShield/RiotShield.ini @@ -119,7 +119,7 @@ AddDevice = HeldDevice Resolution = 4 Depth = 10 DeepCheck = 0 - JointStrength = 220 + JointStrength = 300 JointStiffness = 0.5 JointOffset = Vector X = -2 diff --git a/Base.rte/Devices/Special/Medikit/Medikit.ini b/Base.rte/Devices/Special/Medikit/Medikit.ini index badee03aa..367258cf2 100644 --- a/Base.rte/Devices/Special/Medikit/Medikit.ini +++ b/Base.rte/Devices/Special/Medikit/Medikit.ini @@ -150,4 +150,7 @@ AddDevice = HDFirearm Spread = 2.25 MaxVelocity = 10 MinVelocity = 1 + AddGib = Gib + GibParticle = MOSRotating + CopyOf = Gib Panel White Small D GibWoundLimit = 3 \ No newline at end of file diff --git a/Base.rte/Devices/Special/Medikit/Medikit.lua b/Base.rte/Devices/Special/Medikit/Medikit.lua index df9215807..9c16011f3 100644 --- a/Base.rte/Devices/Special/Medikit/Medikit.lua +++ b/Base.rte/Devices/Special/Medikit/Medikit.lua @@ -19,27 +19,28 @@ function Update(self) end end if target and (target.Health < target.MaxHealth or target.TotalWoundCount > 0) then - local strength = self.baseStrength + math.ceil(2000 / (1 + math.abs(target.Mass) / 2)); + local strength = self.baseStrength + math.ceil(2000/(1 + math.abs(target.Mass)/2)); if target.Health < target.MaxHealth then target.Health = math.min(target.Health + strength, target.MaxHealth); end if target.TotalWoundCount > 0 then - target:RemoveAnyRandomWounds(math.ceil(strength / 7)); + target:RemoveAnyRandomWounds(math.ceil(strength/7)); end target:FlashWhite(50); AudioMan:PlaySound("Base.rte/Sounds/GUIs/SlicePicked.wav", self.Pos); - local targetSize = math.ceil(5 + target.Radius / 2); + local targetSize = math.ceil(5 + target.Radius/2); for i = 1, targetSize do local part = CreateMOPixel("Heal Glow", "Base.rte"); - local vec = Vector(targetSize * 2, 0):RadRotate(6.28 / targetSize * i); - part.Pos = target.Pos + Vector(0, -targetSize / 3):RadRotate(target.RotAngle) + vec; - part.Vel = target.Vel * 0.5 - Vector(vec.X, vec.Y) / 4; + local vec = Vector(targetSize * 2, 0):RadRotate(6.28/targetSize * i); + part.Pos = target.Pos + Vector(0, -targetSize/3):RadRotate(target.RotAngle) + vec; + part.Vel = target.Vel * 0.5 - Vector(vec.X, vec.Y)/4; MovableMan:AddParticle(part); end local cross = CreateMOSParticle("Particle Heal Effect", "Base.rte"); cross.Pos = target.AboveHUDPos + Vector(0, 5); MovableMan:AddParticle(cross); + self.ToDelete = true; end end diff --git a/Base.rte/Devices/Tools/Constructor/Constructor.ini b/Base.rte/Devices/Tools/Constructor/Constructor.ini index c63752911..9d8db4267 100644 --- a/Base.rte/Devices/Tools/Constructor/Constructor.ini +++ b/Base.rte/Devices/Tools/Constructor/Constructor.ini @@ -17,13 +17,13 @@ AddEffect = MOSRotating AtomGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Metal + CopyOf = Concrete Resolution = 1 Depth = 1 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material - CopyOf = Metal + CopyOf = Concrete Resolution = 1 Depth = 1 DeepCheck = 0 @@ -477,39 +477,6 @@ AddActor = AtomGroup Y = 0 -AddActor = Actor - PresetName = Constructor Cursor - Mass = 1 - RestThreshold = -500 - HitsMOs = 0 - GetsHitByMOs = 0 - LifeTime = 100 - Sharpness = -1 - ScriptPath = Base.rte/Devices/Tools/Constructor/Cursor.lua - SpriteFile = ContentFile - FilePath = Base.rte/Null.bmp - FrameCount = 1 - SpriteOffset = Vector - X = -1 - Y = -1 - Buyable = 0 - AtomGroup = AtomGroup - CopyOf = Constructor Null AtomGroup - DeepCheck = 0 - Status = 0 - Health = 100 - Team = 0 - Perceptiveness = 0.0 - AimAngle = 0 - AimDistance = 0 - CharHeight = 99999 - HolsterOffset = Vector - X = -0 - Y = -0 - GibImpulseLimit = 10000 - GibWoundLimit = 10000 - - AddAmmo = Magazine PresetName = Magazine Constructor Mass = 1 @@ -567,7 +534,9 @@ AddDevice = HDFirearm Mass = 8 HitsMOs = 0 GetsHitByMOs = 1 - Sharpness = 0 + ProvidesPieMenuContext = 1 + AddCustomValue = StringValue + ConstructorMode = Dig ScriptPath = Base.rte/Devices/Tools/Constructor/Constructor.lua SpriteFile = ContentFile FilePath = Base.rte/Devices/Tools/Constructor/ConstructorA.bmp diff --git a/Base.rte/Devices/Tools/Constructor/Constructor.lua b/Base.rte/Devices/Tools/Constructor/Constructor.lua index 93ad9d9b0..08cd72a89 100644 --- a/Base.rte/Devices/Tools/Constructor/Constructor.lua +++ b/Base.rte/Devices/Tools/Constructor/Constructor.lua @@ -2,7 +2,7 @@ function OnPieMenu(item) if item and IsHDFirearm(item) and item.PresetName == "Constructor" then item = ToHDFirearm(item); - if item:GetNumberValue("Constructor Mode") == 1 then + if item:GetStringValue("ConstructorMode") == "Spray" then ToGameActivity(ActivityMan:GetActivity()):RemovePieMenuSlice("Spray Mode", "ConstructorSprayMode"); else ToGameActivity(ActivityMan:GetActivity()):RemovePieMenuSlice("Dig Mode", "ConstructorDigMode"); @@ -11,7 +11,7 @@ function OnPieMenu(item) end function ConstructorWrapPos(checkPos) - if SceneMan.SceneWrapsX == true then + if SceneMan.SceneWrapsX then if checkPos.X > SceneMan.SceneWidth then checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); elseif checkPos.X < 0 then @@ -28,25 +28,25 @@ function ConstructorFloodFill(x, y, startnum, maxnum, array, realposition, reals if startnum < maxnum then if array[x+1][y] == -1 or array[x+1][y] > startnum then local checkPos = ConstructorWrapPos(realposition + Vector(realspacing,0)); - if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == 0 then + if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == rte.airID then ConstructorFloodFill(x+1, y, startnum+1, maxnum, array, checkPos, realspacing); end end if array[x-1][y] == -1 or array[x-1][y] > startnum then local checkPos = ConstructorWrapPos(realposition + Vector(-realspacing,0)); - if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == 0 then + if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == rte.airID then ConstructorFloodFill(x-1, y, startnum+1, maxnum, array, checkPos, realspacing); end end if array[x][y+1] == -1 or array[x][y+1] > startnum then local checkPos = ConstructorWrapPos(realposition + Vector(0,realspacing)); - if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == 0 then + if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == rte.airID then ConstructorFloodFill(x, y+1, startnum+1, maxnum, array, checkPos, realspacing); end end if array[x][y-1] == -1 or array[x][y-1] > startnum then local checkPos = ConstructorWrapPos(realposition + Vector(0,-realspacing)); - if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == 0 then + if SceneMan:GetTerrMatter(checkPos.X+(realspacing*0.5),checkPos.Y+(realspacing*0.5)) == rte.airID then ConstructorFloodFill(x, y-1, startnum+1, maxnum, array, checkPos, realspacing); end end @@ -69,7 +69,7 @@ function ConstructorTerrainRay(start, trace, skip) local invector = start + Vector(skip*i,0):RadRotate(angle); local checkPos = ConstructorWrapPos(invector); local terrCheck = SceneMan:GetTerrMatter(checkPos.X,checkPos.Y); - if terrCheck ~= 0 then + if terrCheck ~= rte.airID then roughLandPos = checkPos; break; end @@ -81,7 +81,7 @@ function ConstructorTerrainRay(start, trace, skip) local checkPos = ConstructorWrapPos(invector); local terrCheck = SceneMan:GetTerrMatter(checkPos.X,checkPos.Y); roughLandPos = checkPos; - if terrCheck ~= 0 then + if terrCheck ~= rte.airID then break; end end @@ -93,7 +93,7 @@ end function Create(self) self.fireTimer = Timer(); - self.fired = false; + self.displayTimer = Timer(); self.startresource = 3; -- how many blocks of concrete to start with @@ -107,7 +107,7 @@ function Create(self) self.clearer = CreateMOSRotating("Constructor Terrain Clearer"); - self.digstrength = 100; -- the StructualIntegrity limit the device can harvest + self.digstrength = 210; -- the StructualIntegrity limit the device can harvest self.diglength = 50; self.digspersecond = 100; @@ -123,6 +123,7 @@ function Create(self) self.toautobuild = false; self.aicontrolled = false; self.displaygrid = true; + self.cursormovespeed = 2; -- autobuild for standard units self.autobuildlist = { @@ -196,7 +197,7 @@ end function Update(self) - if self.RootID ~= 255 then + if self.RootID ~= rte.NoMOID then local actor = MovableMan:GetMOFromID(self.RootID); if MovableMan:IsActor(actor) then @@ -204,20 +205,21 @@ function Update(self) local ctrl = actor:GetController(); local screen = ActivityMan:GetActivity():ScreenOfPlayer(ctrl.Player); - if self.Magazine ~= nil then + if self.Magazine then self.Magazine.RoundCount = self.resource; end - -- display dig/spray mode when opening pie menu - local mode = {"Dig", "Spray"}; if ctrl:IsState(Controller.PIE_MENU_ACTIVE) then - PrimitiveMan:DrawTextPrimitive(screen, actor.AboveHUDPos + Vector(0, 26), "Mode: " .. mode[self:GetNumberValue("Constructor Mode") + 1], true, 1); + PrimitiveMan:DrawTextPrimitive(screen, actor.AboveHUDPos + Vector(0, 26), "Mode: ".. self:GetStringValue("ConstructorMode"), true, 1); end -- constructor actions if the user is in gold dig mode if actor.AIMode == Actor.AIMODE_GOLDDIG then if self.toautobuild == false then if actor:IsPlayerControlled() == false then + if self:GetStringValue("ConstructorMode") == "Spray" then + self:SetStringValue("ConstructorMode", "Dig"); + end if ctrl:IsState(Controller.WEAPON_FIRE) and SceneMan:ShortestDistance(actor.Pos, ConstructorTerrainRay(actor.Pos,Vector(0,50),3), SceneMan.SceneWrapsX).Magnitude < 30 then self.tunnelFillTimer:Reset(); self.aicontrolled = true; @@ -287,20 +289,19 @@ function Update(self) end end end - end end else self.toautobuild = false; end - - if self.Sharpness == 0 then -- dig/spray + local mode = self:GetNumberValue("BuildMode"); + if mode == 0 then -- activation if ctrl:IsState(Controller.WEAPON_FIRE) then local angle = actor:GetAimAngle(true); - if self:GetNumberValue("Constructor Mode") == 1 then + if self:GetStringValue("ConstructorMode") == "Spray" then if self.resource > self.buildcost / 5 then for i = 1, 4 do @@ -341,7 +342,7 @@ function Update(self) self.clearer:EraseFromTerrain(); local collectfx2 = CreateMOPixel("Particle Constructor Gather Material Gold"); collectfx2.Pos = Vector(checkpos.X,checkpos.Y); - collectfx2.Sharpness = self.UniqueID; + collectfx2.Sharpness = self.ID; MovableMan:AddParticle(collectfx2); else local matstrength = SceneMan:CastStrengthSumRay(Vector(checkpos.X,checkpos.Y-1),Vector(checkpos.X,checkpos.Y),0,0); @@ -364,80 +365,111 @@ function Update(self) if diddig then local collectfx = CreateMOPixel("Particle Constructor Gather Material"); collectfx.Pos = Vector(digpos.X,digpos.Y); - collectfx.Sharpness = self.UniqueID; + collectfx.Sharpness = self.ID; MovableMan:AddParticle(collectfx); end - else -- deactivate if digging air self:Deactivate(); break; end - end - end - else self.fireTimer:Reset(); end - elseif self.Sharpness == 1 then -- cancel - self.Sharpness = 0; + elseif mode == 1 then -- cancel + self:RemoveNumberValue("BuildMode"); self.buildlist = {}; + self.cursor = nil; - elseif self.Sharpness == 2 then -- build - self.Sharpness = 0; + elseif mode == 2 then -- build + self:RemoveNumberValue("BuildMode"); -- constructor build cursor + if actor:IsPlayerControlled() then + self.cursor = Vector(self.MuzzlePos.X, self.MuzzlePos.Y); + end + end + local displayColorBlue = 5; + local displayColorYellow = 120; + local displayColorRed = 13; + local displayColorWhite = 254; + if self.displayTimer:IsPastSimMS(TimerMan.DeltaTimeMS) then + self.displayTimer:Reset(); + -- flickering colors + displayColorBlue = 195; + displayColorYellow = 116; + displayColorRed = 12; + displayColorWhite = 252; + end - if MovableMan:IsActor(self.cursor) then - self.cursor.Sharpness = -2; + if self.cursor then + + actor.ViewPoint = self.cursor; + + local cursorMovement = Vector(); + + if ctrl:IsMouseControlled() then + cursorMovement = cursorMovement + ctrl.MouseMovement; + else + if ctrl:IsState(Controller.HOLD_UP) or ctrl:IsState(Controller.BODY_JUMP) then + cursorMovement = cursorMovement + Vector(0, -1); + end + if ctrl:IsState(Controller.HOLD_DOWN) or ctrl:IsState(Controller.BODY_CROUCH) then + cursorMovement = cursorMovement + Vector(0, 1); + end + if ctrl:IsState(Controller.HOLD_LEFT) then + cursorMovement = cursorMovement + Vector(-1, 0); + end + if ctrl:IsState(Controller.HOLD_RIGHT) then + cursorMovement = cursorMovement + Vector(1, 0); + end end - if actor:IsPlayerControlled() then - self.cursor = CreateActor("Constructor Cursor"); - self.cursor.Pos = self.MuzzlePos; - self.cursor.Team = actor.Team; - self.cursor.Sharpness = self.UniqueID; - MovableMan:AddActor(self.cursor); - ActivityMan:GetActivity():SwitchToActor(self.cursor, ctrl.Player, actor.Team); + if cursorMovement.Magnitude > 0 then + if ctrl:IsMouseControlled() then + self.cursor = self.cursor + cursorMovement; + else + self.cursor = self.cursor + cursorMovement:SetMagnitude(self.cursormovespeed); + end end - end - if MovableMan:IsActor(self.cursor) then - if self.cursor.Sharpness == self.UniqueID then + local mapx = math.floor((self.cursor.X - 12)/24) * 24 + 12; + local mapy = math.floor((self.cursor.Y - 12)/24) * 24 + 12; - local mapx = math.floor((self.cursor.Pos.X-12)/24)*24+12; - local mapy = math.floor((self.cursor.Pos.Y-12)/24)*24+12; - PrimitiveMan:DrawBoxPrimitive(screen, Vector(mapx, mapy), Vector(mapx+23, mapy+23), 120); + PrimitiveMan:DrawLinePrimitive(screen, self.cursor + Vector(0, 4), self.cursor + Vector(0, -4), displayColorYellow); + PrimitiveMan:DrawLinePrimitive(screen, self.cursor + Vector(4, 0), self.cursor + Vector(-4, 0), displayColorYellow); + PrimitiveMan:DrawBoxPrimitive(screen, Vector(mapx, mapy), Vector(mapx + 23, mapy + 23), displayColorYellow); + if ctrl:IsState(Controller.PIE_MENU_ACTIVE) then + self.cursor = nil; + elseif actor:IsPlayerControlled() then -- add blocks to the build queue if the cursor is firing - if self.cursor:IsPlayerControlled() then - if self.cursor:GetController():IsState(Controller.WEAPON_FIRE) then - local freeslot = true; - for i = 1, #self.buildlist do - if self.buildlist[i] ~= nil and self.buildlist[i][1] == mapx and self.buildlist[i][2] == mapy then - freeslot = false; - break; - end - end - if freeslot then - local buildthis = {}; - buildthis[1] = mapx; - buildthis[2] = mapy; - buildthis[3] = 0; - self.buildlist[#self.buildlist+1] = buildthis; + if ctrl:IsState(Controller.WEAPON_FIRE) then + local freeslot = true; + for i = 1, #self.buildlist do + if self.buildlist[i] ~= nil and self.buildlist[i][1] == mapx and self.buildlist[i][2] == mapy then + freeslot = false; + break; end end - else - self.cursor.Sharpness = -2; + if freeslot then + local buildthis = {}; + buildthis[1] = mapx; + buildthis[2] = mapy; + buildthis[3] = 0; + self.buildlist[#self.buildlist+1] = buildthis; + end + end + for state = 0, 40 do -- go through and disable all 41 controller states when moving the build cursor + ctrl:SetState(state, false); end else self.cursor = nil; end end - -- clean up the build list of nil slots and draw the squares to show the build layout local templist = {}; for i = 1, #self.buildlist do @@ -445,9 +477,9 @@ function Update(self) templist[#templist+1] = self.buildlist[i]; if self.displaygrid then if SceneMan:ShortestDistance(actor.Pos, Vector(self.buildlist[i][1],self.buildlist[i][2]), SceneMan.SceneWrapsX).Magnitude < self.builddistance then - PrimitiveMan:DrawBoxPrimitive(screen, Vector(self.buildlist[i][1],self.buildlist[i][2]), Vector(self.buildlist[i][1]+23,self.buildlist[i][2]+23), 5); + PrimitiveMan:DrawBoxPrimitive(screen, Vector(self.buildlist[i][1],self.buildlist[i][2]), Vector(self.buildlist[i][1]+23,self.buildlist[i][2]+23), displayColorBlue); else - PrimitiveMan:DrawBoxPrimitive(screen, Vector(self.buildlist[i][1],self.buildlist[i][2]), Vector(self.buildlist[i][1]+23,self.buildlist[i][2]+23), 13); + PrimitiveMan:DrawBoxPrimitive(screen, Vector(self.buildlist[i][1],self.buildlist[i][2]), Vector(self.buildlist[i][1]+23,self.buildlist[i][2]+23), displayColorRed); end end end @@ -459,7 +491,7 @@ function Update(self) self.buildTimer:Reset(); for i = 1, buildamount do if self.resource > self.buildcost then - if self.buildlist[1] ~= nil then + if self.buildlist[1] then if SceneMan:ShortestDistance(actor.Pos, Vector(self.buildlist[1][1],self.buildlist[1][2]), SceneMan.SceneWrapsX).Magnitude < self.builddistance then @@ -469,17 +501,18 @@ function Update(self) local bx = self.buildlist[1][3]-(by*8); by = by*3-1; bx = bx*3-1; - - PrimitiveMan:DrawLinePrimitive(screen, self.Pos, self.Pos + SceneMan:ShortestDistance(self.Pos, Vector(bx+self.buildlist[1][1]+2,by+self.buildlist[1][2]+2), SceneMan.SceneWrapsX ), 5); - PrimitiveMan:DrawBoxFillPrimitive(screen, Vector(bx+self.buildlist[1][1]+1,by+self.buildlist[1][2]+1),Vector(bx+self.buildlist[1][1]+3,by+self.buildlist[1][2]+3),254); + local bpos = self.Pos + SceneMan:ShortestDistance(self.Pos, Vector(bx+self.buildlist[1][1]+2,by+self.buildlist[1][2]+2), SceneMan.SceneWrapsX); + PrimitiveMan:DrawLinePrimitive(screen, self.Pos, bpos, displayColorBlue); + PrimitiveMan:DrawBoxFillPrimitive(screen, Vector(bx+self.buildlist[1][1]+1,by+self.buildlist[1][2]+1),Vector(bx+self.buildlist[1][1]+3,by+self.buildlist[1][2]+3), displayColorWhite); + for x = 1, 3 do for y = 1, 3 do local name = ""; if bx+x == 0 or bx+x == 23 or by+y == 0 or by+y == 23 then - name = "Particle Constructor Concrete Border "..(math.floor(math.random()*4)+1); + name = "Particle Constructor Concrete Border "..math.random(4); else - name = "Particle Constructor Concrete "..(math.floor(math.random()*13)+1); + name = "Particle Constructor Concrete "..math.random(13); end local terrainpar = CreateMOPixel(name); terrainpar.Pos = ConstructorWrapPos(Vector(bx+self.buildlist[1][1]+x,by+self.buildlist[1][2]+y)); @@ -487,6 +520,7 @@ function Update(self) terrainpar.ToSettle = true; end end + AudioMan:PlaySound("Base.rte/Sounds/Geiger".. math.random(3) ..".wav", bpos); self.buildlist[1][3] = self.buildlist[1][3] + 1; else self.buildlist[1] = nil; @@ -496,24 +530,14 @@ function Update(self) self.buildlist[#self.buildlist+1] = self.buildlist[1]; self.buildlist[1] = nil; end - end end end - - else - if MovableMan:IsActor(self.cursor) then - self.cursor.Sharpness = -2; - self.cursor = nil; + if display then + self.displayTimer:Reset(); end + elseif self.cursor then + self.cursor = nil; end - - end - -end - -function Destroy(self) - if MovableMan:IsActor(self.cursor) then - self.cursor.Sharpness = -2; end end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Constructor/ConstructorCollect.lua b/Base.rte/Devices/Tools/Constructor/ConstructorCollect.lua index 2ea1df325..f5b6f2d0c 100644 --- a/Base.rte/Devices/Tools/Constructor/ConstructorCollect.lua +++ b/Base.rte/Devices/Tools/Constructor/ConstructorCollect.lua @@ -3,15 +3,12 @@ function Create(self) self.speed = 8; self.ToSettle = false; - if self.Sharpness > -1 then - for i = 1, MovableMan:GetMOIDCount()-1 do - local mo = MovableMan:GetMOFromID(i); - if mo.UniqueID == self.Sharpness then - self.target = mo; - self.Sharpness = 0; - self.PinStrength = 0; - break; - end + if self.Sharpness ~= rte.NoMOID then + local mo = MovableMan:GetMOFromID(self.Sharpness); + if mo then + self.target = mo; + self.Sharpness = 0; + self.PinStrength = 0; end else self.ToDelete = true; @@ -21,7 +18,7 @@ end function Update(self) self.ToSettle = false; - if self.target ~= nil and self.target.ID ~= 255 then + if self.target and self.target.ID ~= rte.NoMOID then local dist = SceneMan:ShortestDistance(self.Pos, self.target.Pos, SceneMan.SceneWrapsX); if dist.Magnitude > self.speed then self.Vel = Vector(dist.X,dist.Y):SetMagnitude(self.speed); diff --git a/Base.rte/Devices/Tools/Constructor/ConstructorCollectGold.lua b/Base.rte/Devices/Tools/Constructor/ConstructorCollectGold.lua index d70d0f59f..20a5ca1a3 100644 --- a/Base.rte/Devices/Tools/Constructor/ConstructorCollectGold.lua +++ b/Base.rte/Devices/Tools/Constructor/ConstructorCollectGold.lua @@ -5,15 +5,12 @@ function Create(self) self.lifeTimer = Timer(); self.ToSettle = false; - if self.Sharpness > -1 then - for i = 1, MovableMan:GetMOIDCount()-1 do - local mo = MovableMan:GetMOFromID(i); - if mo.UniqueID == self.Sharpness then - self.target = mo; - self.Sharpness = 0; - self.PinStrength = 0; - break; - end + if self.Sharpness ~= rte.NoMOID then + local mo = MovableMan:GetMOFromID(self.Sharpness); + if mo then + self.target = mo; + self.Sharpness = 0; + self.PinStrength = 0; end else self.ToDelete = true; @@ -23,7 +20,7 @@ end function Update(self) self.ToSettle = false; - if self.target ~= nil and self.target.ID ~= 255 then + if self.target and self.target.ID ~= rte.NoMOID then local dist = SceneMan:ShortestDistance(self.Pos, self.target.Pos, SceneMan.SceneWrapsX); self.Vel = Vector(dist.X,dist.Y):SetMagnitude(self.speed); end diff --git a/Base.rte/Devices/Tools/Constructor/ConstructorMag.lua b/Base.rte/Devices/Tools/Constructor/ConstructorMag.lua index b78404032..4fb1176d3 100644 --- a/Base.rte/Devices/Tools/Constructor/ConstructorMag.lua +++ b/Base.rte/Devices/Tools/Constructor/ConstructorMag.lua @@ -5,8 +5,8 @@ end function Update(self) - self.Mass = 1 + self.RoundCount / (self.maxresource / 100); -- full mag is 101kg - self.Scale = 0.5 + (self.RoundCount / self.maxresource) * 0.5; + self.Mass = 1 + self.RoundCount/(self.maxresource/100); --Full mag is 101kg + self.Scale = 0.5 + (self.RoundCount/self.maxresource)/2; local fixNum = self.HFlipped and -1 or 0; diff --git a/Base.rte/Devices/Tools/Constructor/ConstructorPie.lua b/Base.rte/Devices/Tools/Constructor/ConstructorPie.lua index 564e9787d..ea8750b80 100644 --- a/Base.rte/Devices/Tools/Constructor/ConstructorPie.lua +++ b/Base.rte/Devices/Tools/Constructor/ConstructorPie.lua @@ -1,29 +1,27 @@ function ConstructorModeCancel(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun.Sharpness = 1; + if gun then + ToMOSRotating(gun):SetNumberValue("BuildMode", 1); end end function ConstructorModeBuild(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun.Sharpness = 2; + if gun then + ToMOSRotating(gun):SetNumberValue("BuildMode", 2); end end function ConstructorDigMode(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun = ToMOSRotating(gun); - gun:SetNumberValue("Constructor Mode", 0); + if gun then + ToMOSRotating(gun):SetStringValue("ConstructorMode", "Dig"); end end function ConstructorSprayMode(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun = ToMOSRotating(gun); - gun:SetNumberValue("Constructor Mode", 1); + if gun then + ToMOSRotating(gun):SetStringValue("ConstructorMode", "Spray"); end end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Constructor/Cursor.lua b/Base.rte/Devices/Tools/Constructor/Cursor.lua deleted file mode 100644 index 1ee0dab8d..000000000 --- a/Base.rte/Devices/Tools/Constructor/Cursor.lua +++ /dev/null @@ -1,64 +0,0 @@ -function Create(self) - self.DelayTimer = Timer(); - self.movespeed = 10; - self.futurevel = Vector(0,0); -end - -function Update(self) - self.ToDelete = false; - self.ToSettle = false; - self.AngularVel = 0; - self.RotAngle = 0; - - self.ctrl = self:GetController(); - - local screen = ActivityMan:GetActivity():ScreenOfPlayer(self.ctrl.Player); - PrimitiveMan:DrawLinePrimitive(screen, self.Pos + Vector(0, 4), self.Pos + Vector(0, -4), 120); - PrimitiveMan:DrawLinePrimitive(screen, self.Pos + Vector(4, 0), self.Pos + Vector(-4, 0), 120); - - if self.ctrl:IsMouseControlled() == false then - if self.ctrl:IsState(Controller.HOLD_UP) or self.ctrl:IsState(Controller.BODY_JUMP) then - self.futurevel = self.futurevel + Vector(0,-1); - end - - if self.ctrl:IsState(Controller.HOLD_DOWN) or self.ctrl:IsState(Controller.BODY_CROUCH) then - self.futurevel = self.futurevel + Vector(0,1); - end - - if self.ctrl:IsState(Controller.HOLD_LEFT) then - self.futurevel = self.futurevel + Vector(-1,0); - end - - if self.ctrl:IsState(Controller.HOLD_RIGHT) then - self.futurevel = self.futurevel + Vector(1,0); - end - elseif self.ctrl:IsMouseControlled() == true then - self.futurevel = self.futurevel + self.ctrl.MouseMovement; - end - - if self.futurevel == Vector(0,0) then - self.Vel = ((SceneMan.GlobalAcc * TimerMan.DeltaTimeSecs)*-1); - elseif not(self.futurevel == Vector(0,0)) then - if self.ctrl:IsMouseControlled() == false then - self.Vel = (self.futurevel:SetMagnitude(self.movespeed)) + ((SceneMan.GlobalAcc * TimerMan.DeltaTimeSecs)*-1); - elseif self.ctrl:IsMouseControlled() == true then - self.Vel = (self.futurevel) + ((SceneMan.GlobalAcc * TimerMan.DeltaTimeSecs)*-1); - end - end - - self.futurevel = Vector(0,0); - - if self.Sharpness == -2 or self:IsPlayerControlled() == false then - self.ToDelete = true; - end -end - -function Destroy(self) - ActivityMan:GetActivity():ReportDeath(self.Team,-1); - - if MovableMan:IsParticle(self.drawlighta) then - self.drawlighta.ToDelete = true; - self.drawlighta.LifeTime = 1; - end - -end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Digger/Digger.ini b/Base.rte/Devices/Tools/Digger/Digger.ini index b05d98422..554f9c319 100644 --- a/Base.rte/Devices/Tools/Digger/Digger.ini +++ b/Base.rte/Devices/Tools/Digger/Digger.ini @@ -38,7 +38,7 @@ AddAmmo = Round Mass = 0.05 RestThreshold = 500 LifeTime = 15 - Sharpness = 13 + Sharpness = 15 HitsMOs = 1 GetsHitByMOs = 0 RemoveOrphanTerrainRadius = 5 diff --git a/Base.rte/Devices/Tools/Disarmer/Disarmer.ini b/Base.rte/Devices/Tools/Disarmer/Disarmer.ini index 27bdffec7..1b94c7c67 100644 --- a/Base.rte/Devices/Tools/Disarmer/Disarmer.ini +++ b/Base.rte/Devices/Tools/Disarmer/Disarmer.ini @@ -99,7 +99,7 @@ AddEffect = AEmitter AddAmmo = Magazine PresetName = Magazine Disarmer - Mass = 2 + Mass = 1 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile @@ -170,6 +170,7 @@ AddDevice = HDFirearm SharpLength = 0 Magazine = Magazine CopyOf = Magazine Disarmer + Loudness = 0 RateOfFire = 60 ReloadTime = 2000 FullAuto = 0 @@ -178,14 +179,6 @@ AddDevice = HDFirearm SharpShakeRange = 0 NoSupportFactor = 0 ParticleSpreadRange = 0 - ShellSpreadRange = 0 - ShellAngVelRange = 0 - MuzzleOffset = Vector - X = 0 - Y = 0 - EjectionOffset = Vector - X = -3 - Y = -3 AddGib = Gib GibParticle = MOPixel CopyOf = Spark Yellow 1 @@ -223,7 +216,7 @@ AddDevice = HDFirearm MinVelocity = 5 AddGib = Gib GibParticle = MOSRotating - CopyOf = Gib Device Small D + CopyOf = Gib Device Small I Count = 1 Spread = 2.25 MaxVelocity = 10 diff --git a/Base.rte/Devices/Tools/Disarmer/Disarmer.lua b/Base.rte/Devices/Tools/Disarmer/Disarmer.lua index 878d0bff7..91b3d9f24 100644 --- a/Base.rte/Devices/Tools/Disarmer/Disarmer.lua +++ b/Base.rte/Devices/Tools/Disarmer/Disarmer.lua @@ -16,7 +16,7 @@ function Update(self) if self.Magazine then if self:IsActivated() then if self.fireOn == false then - self.Magazine.RoundCount = 4000-self.overallTimer.ElapsedSimTimeMS; + self.Magazine.RoundCount = 4000 - self.overallTimer.ElapsedSimTimeMS; if self.delayTimer:IsPastSimMS(1000) then self.delayTimer:Reset(); self.blink = false; @@ -77,29 +77,29 @@ function Update(self) self.scanTimer:Reset(); local alarm = false; local alarmType = "Safe"; - if coalitionMineTable ~= nil then - for i = 1, #coalitionMineTable do - if MovableMan:IsParticle(coalitionMineTable[i]) and SceneMan:ShortestDistance(self.Pos,coalitionMineTable[i].Pos,SceneMan.SceneWrapsX).Magnitude < self.disarmRange then + if AntiPersonnelMineTable then + for i = 1, #AntiPersonnelMineTable do + if MovableMan:IsParticle(AntiPersonnelMineTable[i]) and SceneMan:ShortestDistance(self.Pos,AntiPersonnelMineTable[i].Pos,SceneMan.SceneWrapsX).Magnitude < self.disarmRange then alarm = true; - local isFriendly = coalitionMineTable[i].Team == self.Team; + local isFriendly = AntiPersonnelMineTable[i].Team == self.Team; alarmType = isFriendly and alarmType or "Danger"; local detectPar = CreateMOPixel("Disarmer Detection Particle ".. (isFriendly and "Safe" or "Danger")); - detectPar.Pos = coalitionMineTable[i].Pos; + detectPar.Pos = AntiPersonnelMineTable[i].Pos; MovableMan:AddParticle(detectPar); - table.insert(self.targetTable, coalitionMineTable[i]); + table.insert(self.targetTable, AntiPersonnelMineTable[i]); end end end - if coalitionC4TableA ~= nil and coalitionC4TableB ~= nil then - for i = 1, #coalitionC4TableA do - if MovableMan:IsParticle(coalitionC4TableA[i]) and SceneMan:ShortestDistance(self.Pos,coalitionC4TableA[i].Pos,SceneMan.SceneWrapsX).Magnitude < self.disarmRange then + if RemoteExplosiveTableA and RemoteExplosiveTableB then + for i = 1, #RemoteExplosiveTableA do + if MovableMan:IsParticle(RemoteExplosiveTableA[i]) and SceneMan:ShortestDistance(self.Pos,RemoteExplosiveTableA[i].Pos,SceneMan.SceneWrapsX).Magnitude < self.disarmRange then alarm = true; - local isFriendly = coalitionC4TableA[i].Team == self.Team; + local isFriendly = RemoteExplosiveTableA[i].Team == self.Team; alarmType = isFriendly and alarmType or "Danger"; local detectPar = CreateMOPixel("Disarmer Detection Particle ".. (isFriendly and "Safe" or "Danger")); - detectPar.Pos = coalitionC4TableA[i].Pos; + detectPar.Pos = RemoteExplosiveTableA[i].Pos; MovableMan:AddParticle(detectPar); - table.insert(self.targetTable, coalitionC4TableA[i]); + table.insert(self.targetTable, RemoteExplosiveTableA[i]); end end end diff --git a/Base.rte/Devices/Tools/GrappleGun/Grapple.lua b/Base.rte/Devices/Tools/GrappleGun/Grapple.lua index 5cff9b888..2ef1765f4 100644 --- a/Base.rte/Devices/Tools/GrappleGun/Grapple.lua +++ b/Base.rte/Devices/Tools/GrappleGun/Grapple.lua @@ -13,13 +13,11 @@ function Create(self) self.fireVel = 40; -- This immediately overwrites the .ini FireVel self.maxLineLength = 500; - self.setLineLength = 0; - self.lineLength = 0; - self.lineVec = Vector(); self.limitReached = false; self.stretchMode = false; -- Alternative elastic pull mode a là Liero + self.stretchPullRatio = 0.1; self.pieSelection = 0; -- 0 is nothing, 1 is full retract, 2 is partial retract, 3 is partial extend, 4 is full extend self.climbDelay = 10; -- MS time delay between "climbs" to keep the speed consistant @@ -30,7 +28,7 @@ function Create(self) self.autoClimbIntervalA = 4.0; -- How many pixels the rope retracts / extends at a time when auto-climbing (fast) self.autoClimbIntervalB = 2.0; -- How many pixels the rope retracts / extends at a time when auto-climbing (slow) - for i = 1, MovableMan:GetMOIDCount()-1 do + for i = 1, MovableMan:GetMOIDCount() - 1 do local gun = MovableMan:GetMOFromID(i); if gun and gun.ClassName == "HDFirearm" and gun.PresetName == "Grapple Gun" and SceneMan:ShortestDistance(self.Pos, ToHDFirearm(gun).MuzzlePos, self.mapWrapsX).Magnitude < 5 then self.parentGun = ToHDFirearm(gun); @@ -42,15 +40,12 @@ function Create(self) elseif IsACrab(self.parent) then self.parent = ToACrab(self.parent); end - self.Vel = (self.parent.Vel / 2) + Vector(self.fireVel, 0):RadRotate(self.parent:GetAimAngle(true)); - self.parentGun.Sharpness = 0; - for i = 1, MovableMan:GetMOIDCount() - 1 do - local part = MovableMan:GetMOFromID(i); - if part and part.RootID == self.parent.ID and part.ClassName ~= "HDFirearm" and part.ClassName ~= "TDExplosive" and part.ClassName ~= "HeldDevice" then - local radcheck = SceneMan:ShortestDistance(self.parent.Pos, part.Pos, self.mapWrapsX).Magnitude + part.Radius; - if self.parentRadius == nil or (self.parentRadius ~= nil and radcheck > self.parentRadius) then - self.parentRadius = radcheck; - end + self.Vel = (self.parent.Vel/2) + Vector(self.fireVel, 0):RadRotate(self.parent:GetAimAngle(true)); + self.parentGun:RemoveNumberValue("GrappleMode"); + for part in self.parent.Attachables do + local radcheck = SceneMan:ShortestDistance(self.parent.Pos, part.Pos, self.mapWrapsX).Magnitude + part.Radius; + if self.parentRadius == nil or radcheck > self.parentRadius then + self.parentRadius = radcheck; end end self.actionMode = 1; @@ -74,6 +69,7 @@ function Update(self) self.lineLength = self.lineVec.Magnitude; if self.parentGun and self.parentGun.ID ~= rte.NoMOID then + self.parent = ToMOSRotating(MovableMan:GetMOFromID(self.parentGun.RootID)); if self.parentGun.Magazine then @@ -82,9 +78,12 @@ function Update(self) startPos = self.parentGun.Pos; local flipAng = self.parent.HFlipped and 3.14 or 0; self.parentGun.RotAngle = self.lineVec.AbsRadAngle + flipAng; - if self.parentGun.Sharpness ~= 0 then - self.pieSelection = self.parentGun.Sharpness; - self.parentGun.Sharpness = 0; + + local mode = self.parentGun:GetNumberValue("GrappleMode"); + + if mode ~= 0 then + self.pieSelection = mode; + self.parentGun:RemoveNumberValue("GrappleMode"); end if self.parentGun.FiredFrame then if self.actionMode == 1 then @@ -103,7 +102,15 @@ function Update(self) controller = self.parent:GetController(); -- Point the gun towards the hook if our user is holding it if (self.parentGun and self.parentGun.ID ~= rte.NoMOID) and (self.parentGun:GetRootParent().ID == self.parent.ID) then - local offset = Vector(ToMOSprite(self.parentGun:GetParent()):GetSpriteWidth(), 0):RadRotate(self.parent.FlipFactor * (self.lineVec.AbsRadAngle - self.parent:GetAimAngle(true))) + if self.parent:IsPlayerControlled() then + if controller:IsState(Controller.WEAPON_RELOAD) then + self.ToDelete = true; + end + if self.parentGun.Magazine then + self.parentGun.Magazine.RoundCount = 0; + end + end + local offset = Vector(self.lineLength, 0):RadRotate(self.parent.FlipFactor * (self.lineVec.AbsRadAngle - self.parent:GetAimAngle(true))); self.parentGun.StanceOffset = offset; if self.parent.EquippedItem and self.parent.EquippedItem.ID == self.parentGun.ID and (self.parent.Vel.Magnitude < 5 and controller:IsState(Controller.AIM_SHARP)) then self.parentGun.RotAngle = self.parent:GetAimAngle(false) * self.parentGun.FlipFactor; @@ -114,7 +121,7 @@ function Update(self) end -- Prevent the user from spinning like crazy if self.parent.Status > 0 then - self.parent.AngularVel = self.parent.AngularVel / (1 + math.abs(self.parent.AngularVel) * 0.01); + self.parent.AngularVel = self.parent.AngularVel/(1 + math.abs(self.parent.AngularVel) * 0.01); end else -- If the gun is by itself, hide the HUD self.parentGun.HUDVisible = false; @@ -141,17 +148,17 @@ function Update(self) if self.actionMode == 1 then -- Hook is in flight self.rayVec = Vector(); -- Stretch mode: gradually retract the hook for a return hit - if self.stretchMode == true then - self.Vel = self.Vel - self.lineVec / self.maxLineLength; + if self.stretchMode then + self.Vel = self.Vel - Vector(self.lineVec.X, self.lineVec.Y):SetMagnitude(math.sqrt(self.lineLength) * self.stretchPullRatio/2); end local length = math.sqrt(self.Diameter + self.Vel.Magnitude); -- Detect terrain and stick if found local ray = Vector(length, 0):RadRotate(self.Vel.AbsRadAngle); - if SceneMan:CastStrengthRay(self.Pos, ray, 0, self.rayVec, 0, 0, self.mapWrapsX) then + if SceneMan:CastStrengthRay(self.Pos, ray, 0, self.rayVec, 0, rte.airID, self.mapWrapsX) then self.actionMode = 2; else -- Detect MOs and stick if found - local moRay = SceneMan:CastMORay(self.Pos, ray, self.parent.ID, -2, 0, false, 0); - if moRay ~= 255 then + local moRay = SceneMan:CastMORay(self.Pos, ray, self.parent.ID, -2, rte.airID, false, 0); + if moRay ~= rte.NoMOID then self.target = MovableMan:GetMOFromID(moRay); -- Treat pinned MOs as terrain if self.target.PinStrength > 0 then @@ -192,16 +199,16 @@ function Update(self) end self.Pos = movetopos; - local pullamountnumber = math.abs(-self.lineVec.AbsRadAngle + self.Vel.AbsRadAngle) / 6.28; + local pullamountnumber = math.abs(-self.lineVec.AbsRadAngle + self.Vel.AbsRadAngle)/6.28; self.Vel = self.Vel - self.lineVec:SetMagnitude(self.Vel.Magnitude * pullamountnumber); end elseif self.actionMode > 1 then -- Hook has stuck -- Actor mass and velocity affect pull strength negatively, rope length affects positively (diminishes the former) - local parentForces = 1 + (self.parent.Vel.Magnitude * 10 + self.parent.Mass) / (1 + self.lineLength); + local parentForces = 1 + (self.parent.Vel.Magnitude * 10 + self.parent.Mass)/(1 + self.lineLength); local terrVector = Vector(); -- Check if there is terrain between the hook and the user if self.parentRadius ~= nil then - self.terrcheck = SceneMan:CastStrengthRay(self.parent.Pos, self.lineVec:SetMagnitude(self.parentRadius), 0, terrVector, 2, 0, self.mapWrapsX); + self.terrcheck = SceneMan:CastStrengthRay(self.parent.Pos, self.lineVec:SetMagnitude(self.parentRadius), 0, terrVector, 2, rte.airID, self.mapWrapsX); else self.terrcheck = false; end @@ -212,7 +219,7 @@ function Update(self) if self.pieSelection == 1 then if self.setLineLength > self.autoClimbIntervalA and self.terrcheck == false then - self.setLineLength = self.setLineLength - (self.autoClimbIntervalA /parentForces); + self.setLineLength = self.setLineLength - (self.autoClimbIntervalA/parentForces); else self.pieSelection = 0; end @@ -225,22 +232,22 @@ function Update(self) end end -- Control the rope if the user is holding the gun - if self.parentGun and self.parentGun.ID ~= 255 and controller then + if self.parentGun and self.parentGun.ID ~= rte.NoMOID and controller then -- These forces are to help the user nudge across obstructing terrain - local nudge = math.sqrt(self.lineVec.Magnitude + self.parent.Radius) /(10 + self.parent.Vel.Magnitude); + local nudge = math.sqrt(self.lineVec.Magnitude + self.parent.Radius)/(10 + self.parent.Vel.Magnitude); -- Retract automatically by holding fire or control the rope through the pie menu if self.parentGun:IsActivated() and self.climbTimer:IsPastSimMS(self.climbDelay) then self.climbTimer:Reset(); if self.pieSelection == 0 and self.parentGun:IsActivated() then if self.setLineLength > self.autoClimbIntervalA and self.terrcheck == false then - self.setLineLength = self.setLineLength - (self.autoClimbIntervalA /parentForces); + self.setLineLength = self.setLineLength - (self.autoClimbIntervalA/parentForces); else - self.parentGun.Sharpness = 0; + self.parentGun:RemoveNumberValue("GrappleMode"); self.pieSelection = 0; if self.terrcheck ~= false then -- Try to nudge past terrain - local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true)) / 2 + self.parent.FlipFactor * 0.7); + local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true))/2 + self.parent.FlipFactor * 0.7); self.parent.Vel = self.parent.Vel + aimvec; end end @@ -248,7 +255,7 @@ function Update(self) if self.setLineLength < (self.maxLineLength - self.autoClimbIntervalB) then self.setLineLength = self.setLineLength + self.autoClimbIntervalB; else - self.parentGun.Sharpness = 0; + self.parentGun:RemoveNumberValue("GrappleMode"); self.pieSelection = 0; end end @@ -260,7 +267,7 @@ function Update(self) self.climbTimer:Reset(); if self.pieSelection == 0 then if self.climb == 1 then - self.setLineLength = self.setLineLength - (self.climbInterval / parentForces); + self.setLineLength = self.setLineLength - (self.climbInterval/parentForces); elseif self.climb == 2 then self.setLineLength = self.setLineLength + self.climbInterval; end @@ -277,11 +284,11 @@ function Update(self) self.mouseClimbTimer:Reset(); if self.climb == 3 then if (self.setLineLength-self.climbInterval) >= 0 and self.terrcheck == false then - self.setLineLength = self.setLineLength - (self.climbInterval / parentForces); + self.setLineLength = self.setLineLength - (self.climbInterval/parentForces); elseif self.terrcheck ~= false then -- Try to nudge past terrain - local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true)) / 2 + self.parent.FlipFactor * 0.7); + local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true))/2 + self.parent.FlipFactor * 0.7); self.parent.Vel = self.parent.Vel + aimvec; end elseif self.climb == 4 then @@ -309,7 +316,7 @@ function Update(self) self.climb = 1; elseif self.terrcheck ~= false then -- Try to nudge past terrain - local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true)) / 2 + self.parent.FlipFactor * 0.7); + local aimvec = Vector(self.lineVec.Magnitude, 0):SetMagnitude(nudge):RadRotate((self.lineVec.AbsRadAngle + self.parent:GetAimAngle(true))/2 + self.parent.FlipFactor * 0.7); self.parent.Vel = self.parent.Vel + aimvec; end end @@ -324,7 +331,7 @@ function Update(self) if self.actionMode == 2 then -- Stuck terrain if self.stretchMode then - local pullVec = self.lineVec:SetMagnitude(0.15 * math.sqrt(self.lineLength) / parentForces); + local pullVec = self.lineVec:SetMagnitude(0.15 * math.sqrt(self.lineLength)/parentForces); self.parent.Vel = self.parent.Vel + pullVec; elseif self.lineLength > self.setLineLength then @@ -335,7 +342,7 @@ function Update(self) if pullAmountNumber < 0 then pullAmountNumber = pullAmountNumber * -1; end - pullAmountNumber = pullAmountNumber / 6.28; + pullAmountNumber = pullAmountNumber/6.28; self.parent:AddAbsForce(self.lineVec:SetMagnitude(((self.lineLength - self.setLineLength) ^3 ) * pullAmountNumber) + hookVel:SetMagnitude(math.pow(self.lineLength - self.setLineLength,2)*0.8), self.parent.Pos); local moveToPos = self.Pos + (self.lineVec*-1):SetMagnitude(self.setLineLength); @@ -348,26 +355,34 @@ function Update(self) end self.parent.Pos = moveToPos; - local pullAmountNumber = math.abs(self.lineVec.AbsRadAngle - self.parent.Vel.AbsRadAngle) / 6.28; + local pullAmountNumber = math.abs(self.lineVec.AbsRadAngle - self.parent.Vel.AbsRadAngle)/6.28; self.parent.Vel = self.parent.Vel + self.lineVec:SetMagnitude(self.parent.Vel.Magnitude * pullAmountNumber); end elseif self.actionMode == 3 then -- Stuck MO - if self.target.ID ~= 255 then + if self.target.ID ~= rte.NoMOID then self.Pos = self.target.Pos + Vector(self.stickPosition.X, self.stickPosition.Y):RadRotate(self.target.RotAngle - self.stickRotation); self.RotAngle = self.stickDirection + (self.target.RotAngle - self.stickRotation); - if self.lineLength > self.setLineLength then - - local jointStiffness; - local target = self.target; - if target.ID ~= target.RootID then - local mo = MovableMan:GetMOFromID(target.RootID); - if mo.ID ~= 255 and IsAttachable(target) then - -- It's best to apply all the forces to the parent instead of utilizing JointStiffness - target = mo; - end + + local jointStiffness; + local target = self.target; + if target.ID ~= target.RootID then + local mo = MovableMan:GetMOFromID(target.RootID); + if mo.ID ~= rte.NoMOID and IsAttachable(target) then + -- It's best to apply all the forces to the parent instead of utilizing JointStiffness + target = mo; end + end + if self.stretchMode then + + local pullVec = self.lineVec:SetMagnitude(self.stretchPullRatio * math.sqrt(self.lineLength)/parentForces); + self.parent.Vel = self.parent.Vel + pullVec; + + local targetForces = 1 + (target.Vel.Magnitude * 10 + target.Mass)/(1 + self.lineLength); + target.Vel = target.Vel - (pullVec) * parentForces/targetForces; + + elseif self.lineLength > self.setLineLength then -- Take wrapping to account, treat all distances relative to hook local parentPos = target.Pos + SceneMan:ShortestDistance(target.Pos, self.parent.Pos, self.mapWrapsX); -- Add forces to both user and the target MO @@ -377,14 +392,14 @@ function Update(self) if pullAmountNumber < 0 then pullAmountNumber = pullAmountNumber * -1; end - pullAmountNumber = pullAmountNumber / 6.28; + pullAmountNumber = pullAmountNumber/6.28; self.parent:AddAbsForce(self.lineVec:SetMagnitude(((self.lineLength - self.setLineLength) ^3 ) * pullAmountNumber) + hookVel:SetMagnitude(math.pow(self.lineLength - self.setLineLength,2)*0.8), self.parent.Pos); pullAmountNumber = (self.lineVec*-1).AbsRadAngle - (hookVel).AbsRadAngle; if pullAmountNumber < 0 then pullAmountNumber = pullAmountNumber * -1; end - pullAmountNumber = pullAmountNumber / 6.28; + pullAmountNumber = pullAmountNumber/6.28; local targetforce = ((self.lineVec*-1):SetMagnitude(((self.lineLength - self.setLineLength) ^3 ) * pullAmountNumber) + (self.lineVec*-1):SetMagnitude(math.pow(self.lineLength - self.setLineLength,2)*0.8)); target:AddAbsForce(targetforce, self.Pos);--target.Pos + SceneMan:ShortestDistance(target.Pos, self.Pos, self.mapWrapsX)); @@ -403,8 +418,8 @@ function Update(self) if self.canTap == true then controller:SetState(Controller.BODY_CROUCH, false); self.climb = 0; - if self.parentGun ~= nil and self.parentGun.ID ~= 255 then - self.parentGun.Sharpness = 0; + if self.parentGun ~= nil and self.parentGun.ID ~= rte.NoMOID then + self.parentGun:RemoveNumberValue("GrappleMode"); end self.tapTimer:Reset(); self.didTap = true; @@ -424,7 +439,7 @@ function Update(self) -- Fine tuning: take the seam into account when drawing the rope local drawPos = self.parent.Pos + self.lineVec:SetMagnitude(self.lineLength); if self.ToDelete == true then - drawPos = self.parent.Pos + (self.lineVec / 2); + drawPos = self.parent.Pos + (self.lineVec/2); if self.parentGun and self.parentGun.Magazine then -- Show the magazine as if the hook is being retracted self.parentGun.Magazine.Pos = drawPos; @@ -444,8 +459,8 @@ function Destroy(self) if MovableMan:IsParticle(self.crankSound) then self.crankSound.ToDelete = true; end - if self.parentGun and self.parentGun.ID ~= 255 then + if self.parentGun and self.parentGun.ID ~= rte.NoMOID then self.parentGun.HUDVisible = true; - self.parentGun.Sharpness = 0; + self.parentGun:RemoveNumberValue("GrappleMode"); end end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/GrappleGun/GrappleGun.ini b/Base.rte/Devices/Tools/GrappleGun/GrappleGun.ini index 029e81a99..40a5a5c4f 100644 --- a/Base.rte/Devices/Tools/GrappleGun/GrappleGun.ini +++ b/Base.rte/Devices/Tools/GrappleGun/GrappleGun.ini @@ -118,6 +118,7 @@ AddAmmo = Magazine Mass = 0 HitsMOs = 0 GetsHitByMOs = 0 + CollidesWithTerrainWhenAttached = 1 SpriteFile = ContentFile FilePath = Base.rte/Devices/Tools/GrappleGun/Claw.bmp FrameCount = 2 @@ -150,7 +151,7 @@ AddAmmo = Magazine X = 0 Y = 0 DrawAfterParent = 0 - RoundCount = -1 // Means infinite ammo + RoundCount = -1 RTTRatio = 0 Discardable = 0 RegularRound = Round @@ -161,7 +162,7 @@ AddAmmo = Magazine AddDevice = HDFirearm PresetName = Grapple Gun AddToGroup = Tools - Description = Use this to climb walls and descend dangerous drops! Climb up by crouching and then holding up/down or scrolling up/down. + Description = Use this to climb walls and descend dangerous drops! Control the length of the rope by crouching and then holding up/down or scrolling up/down. Reload or double tap crouch to release the hook. Mass = 5 Sharpness = 0 HitsMOs = 0 @@ -198,7 +199,7 @@ AddDevice = HDFirearm X = -2 Y = 1.5 DrawAfterParent = 0 - DualWieldable = 1 + DualWieldable = 0 StanceOffset = Vector X = 12 Y = 1 @@ -216,19 +217,8 @@ AddDevice = HDFirearm AttenuationStartDistance = 145 AddSound = ContentFile FilePath = Base.rte/Devices/Tools/GrappleGun/Sounds/ClawFire.wav - EmptySound = SoundContainer - AddSound = ContentFile - FilePath = Base.rte/Sounds/Devices/EmptyClick1.wav - ReloadStartSound = SoundContainer - AttenuationStartDistance = 100 - AddSound = ContentFile - FilePath = Base.rte/Sounds/Devices/ReloadStart.wav - ReloadEndSound = SoundContainer - AttenuationStartDistance = 110 - AddSound = ContentFile - FilePath = Base.rte/Sounds/Devices/ReloadEnd.wav RateOfFire = 500 - ReloadTime = 2000 + ReloadTime = 0 FullAuto = 0 FireIgnoresThis = 1 ShakeRange = 1 @@ -263,6 +253,16 @@ AddDevice = HDFirearm FilePath = Base.rte/Devices/Tools/GrappleGun/PieIcons/Extend.bmp ScriptPath = Base.rte/Devices/Tools/GrappleGun/Pie.lua FunctionName = GrapplePieExtend + AddPieSlice = Slice + Description = Toggle Dual Wield + Direction = 3 + Icon = Icon + PresetName = Grapple Gun Hand + FrameCount = 2 + BitmapFile = ContentFile + FilePath = Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand.bmp + ScriptPath = Base.rte/Devices/Tools/GrappleGun/Pie.lua + FunctionName = GrapplePieDualWield AddGib = Gib GibParticle = MOPixel CopyOf = Spark Yellow 1 diff --git a/Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua b/Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua index fa9a42e8f..3e45cfac3 100644 --- a/Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua +++ b/Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua @@ -66,7 +66,7 @@ function Update(self) if parent.Vel.Magnitude > 12 then frame = 1; end - local startPos = (parent.Pos + parent.EyePos + self.Pos) / 3; + local startPos = (parent.Pos + parent.EyePos + self.Pos)/3; local guidePos = startPos + Vector(parent.AimDistance + (parent.Vel.Magnitude), 0):RadRotate(parent:GetAimAngle(true)); PrimitiveMan:DrawBitmapPrimitive(ActivityMan:GetActivity():ScreenOfPlayer(controller.Player), guidePos, self.arrow, parent:GetAimAngle(true), frame); end @@ -76,8 +76,9 @@ function Update(self) self.StanceOffset = Vector(ToMOSprite(self:GetParent()):GetSpriteWidth(), 1); self.SharpStanceOffset = Vector(ToMOSprite(self:GetParent()):GetSpriteWidth(), 1); if self.Magazine then + self.Magazine.RoundCount = 1; self.Magazine.Scale = 1; - self.Magazine.Frame = 1; + self.Magazine.Frame = 0; end end end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/GrappleGun/Pie.lua b/Base.rte/Devices/Tools/GrappleGun/Pie.lua index 05cb42de7..a0c7caf7e 100644 --- a/Base.rte/Devices/Tools/GrappleGun/Pie.lua +++ b/Base.rte/Devices/Tools/GrappleGun/Pie.lua @@ -1,13 +1,20 @@ function GrapplePieRetract(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun.Sharpness = 1; + if gun then + ToMOSRotating(gun):SetNumberValue("GrappleMode", 1); end end function GrapplePieExtend(actor) local gun = ToAHuman(actor).EquippedItem; - if gun ~= nil then - gun.Sharpness = 2; + if gun then + ToMOSRotating(gun):SetNumberValue("GrappleMode", 2); + end +end + +function GrapplePieDualWield(actor) + local gun = ToAHuman(actor).EquippedItem; + if gun then + ToHDFirearm(gun):SetDualWieldable(not ToHDFirearm(gun):IsDualWieldable()); end end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand000.bmp b/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand000.bmp new file mode 100644 index 000000000..296f80d51 Binary files /dev/null and b/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand000.bmp differ diff --git a/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand001.bmp b/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand001.bmp new file mode 100644 index 000000000..704307d4f Binary files /dev/null and b/Base.rte/Devices/Tools/GrappleGun/PieIcons/Hand001.bmp differ diff --git a/Base.rte/Devices/Tools/Repeller/Repeller.ini b/Base.rte/Devices/Tools/Repeller/Repeller.ini index d3e554308..13f74d237 100644 --- a/Base.rte/Devices/Tools/Repeller/Repeller.ini +++ b/Base.rte/Devices/Tools/Repeller/Repeller.ini @@ -96,6 +96,7 @@ AddDevice = HDFirearm ExitWound = AEmitter CopyOf = Dent Metal GoldValue = 20 + Buyable = 0 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material diff --git a/Base.rte/Devices/Tools/Scanner/Scanner.ini b/Base.rte/Devices/Tools/Scanner/Scanner.ini index d8b03f201..effd3a5fc 100644 --- a/Base.rte/Devices/Tools/Scanner/Scanner.ini +++ b/Base.rte/Devices/Tools/Scanner/Scanner.ini @@ -1,33 +1,3 @@ -/////////////////////////////////////////////////////////////////////// -// Scanner Ammo - - -AddAmmo = Magazine - PresetName = Magazine Scanner - Mass = 0 - HitsMOs = 0 - GetsHitByMOs = 0 - SpriteFile = ContentFile - FilePath = Base.rte/Null.bmp - AtomGroup = AtomGroup - CopyOf = Null AtomGroup - JointStrength = 200 - JointStiffness = 1 - RoundCount = -1 - RTTRatio = 0 - RegularRound = Round - PresetName = Round Scanner - ParticleCount = 1 - Particle = MOPixel - CopyOf = Null Bullet - Shell = None - FireVelocity = 1 - ShellVelocity = 0 - Separation = 0 - TracerRound = None - Discardable = 0 - - /////////////////////////////////////////////////////////////////////////////// // Scanners @@ -39,7 +9,17 @@ AddDevice = HDFirearm Mass = 5 HitsMOs = 0 GetsHitByMOs = 1 - ScriptPath = Base.rte/Devices/Tools/Scanner/ScannerLight.lua + ScriptPath = Base.rte/Devices/Tools/Scanner/Scanner.lua + AddCustomValue = NumberValue + ScanDelay = 100 + AddCustomValue = NumberValue + MaxScanRange = 300 + AddCustomValue = NumberValue + ScanDisruption = 200 + AddCustomValue = NumberValue + ScanSpacing = 10 + AddCustomValue = NumberValue + NumberOfScans = 2 SpriteFile = ContentFile FilePath = Base.rte/Devices/Tools/Scanner/LightScanner.bmp FrameCount = 2 @@ -70,7 +50,6 @@ AddDevice = HDFirearm X = -4 Y = 4 DrawAfterParent = 0 - OneHanded = 1 StanceOffset = Vector X = 8 Y = 5 @@ -82,7 +61,7 @@ AddDevice = HDFirearm Y = 2 SharpLength = 0 Magazine = Magazine - CopyOf = Magazine Scanner + CopyOf = Null Magazine Infinite // Flash = Attachable // CopyOf = Muzzle Flash SMG FireSound = SoundContainer @@ -108,7 +87,7 @@ AddDevice = HDFirearm ShakeRange = 0 SharpShakeRange = 0 NoSupportFactor = 0 - ParticleSpreadRange = 0 + ParticleSpreadRange = 10 ShellSpreadRange = 0 ShellAngVelRange = 0 MuzzleOffset = Vector @@ -176,7 +155,17 @@ AddDevice = HDFirearm Mass = 7 HitsMOs = 0 GetsHitByMOs = 1 - ScriptPath = Base.rte/Devices/Tools/Scanner/ScannerMedium.lua + ScriptPath = Base.rte/Devices/Tools/Scanner/Scanner.lua + AddCustomValue = NumberValue + ScanDelay = 100 + AddCustomValue = NumberValue + MaxScanRange = 400 + AddCustomValue = NumberValue + ScanDisruption = 250 + AddCustomValue = NumberValue + ScanSpacing = 10 + AddCustomValue = NumberValue + NumberOfScans = 4 SpriteFile = ContentFile FilePath = Base.rte/Devices/Tools/Scanner/MediumScanner.bmp FrameCount = 2 @@ -207,7 +196,6 @@ AddDevice = HDFirearm X = -5 Y = 4 DrawAfterParent = 0 - OneHanded = 1 StanceOffset = Vector X = 8 Y = 5 @@ -219,7 +207,7 @@ AddDevice = HDFirearm Y = 3 SharpLength = 0 Magazine = Magazine - CopyOf = Magazine Scanner + CopyOf = Null Magazine Infinite // Flash = Attachable // CopyOf = Muzzle Flash SMG FireSound = SoundContainer @@ -242,7 +230,7 @@ AddDevice = HDFirearm ShakeRange = 0 SharpShakeRange = 0 NoSupportFactor = 0 - ParticleSpreadRange = 0 + ParticleSpreadRange = 20 ShellSpreadRange = 0 ShellAngVelRange = 0 MuzzleOffset = Vector @@ -310,7 +298,17 @@ AddDevice = HDFirearm Mass = 12 HitsMOs = 0 GetsHitByMOs = 1 - ScriptPath = Base.rte/Devices/Tools/Scanner/ScannerHeavy.lua + ScriptPath = Base.rte/Devices/Tools/Scanner/Scanner.lua + AddCustomValue = NumberValue + ScanDelay = 100 + AddCustomValue = NumberValue + MaxScanRange = 500 + AddCustomValue = NumberValue + ScanDisruption = 300 + AddCustomValue = NumberValue + ScanSpacing = 10 + AddCustomValue = NumberValue + NumberOfScans = 6 SpriteFile = ContentFile FilePath = Base.rte/Devices/Tools/Scanner/HeavyScanner.bmp FrameCount = 2 @@ -341,7 +339,6 @@ AddDevice = HDFirearm X = -5 Y = 4 DrawAfterParent = 0 - OneHanded = 1 StanceOffset = Vector X = 8 Y = 5 @@ -353,7 +350,7 @@ AddDevice = HDFirearm Y = 3 SharpLength = 0 Magazine = Magazine - CopyOf = Magazine Scanner + CopyOf = Null Magazine Infinite // Flash = Attachable // CopyOf = Muzzle Flash SMG FireSound = SoundContainer @@ -376,7 +373,7 @@ AddDevice = HDFirearm ShakeRange = 0 SharpShakeRange = 0 NoSupportFactor = 0 - ParticleSpreadRange = 0 + ParticleSpreadRange = 30 ShellSpreadRange = 0 ShellAngVelRange = 0 MuzzleOffset = Vector diff --git a/Base.rte/Devices/Tools/Scanner/Scanner.lua b/Base.rte/Devices/Tools/Scanner/Scanner.lua new file mode 100644 index 000000000..edd1454b7 --- /dev/null +++ b/Base.rte/Devices/Tools/Scanner/Scanner.lua @@ -0,0 +1,55 @@ +function Create(self) + self.ScanTimer = Timer(); + + self.scanDelay = self:GetNumberValue("ScanDelay"); + self.maxScanRange = self:GetNumberValue("MaxScanRange"); + self.scanDisruption = self:GetNumberValue("ScanDisruption"); + self.scanSpacing = self:GetNumberValue("ScanSpacing"); + self.numberOfScans = self:GetNumberValue("NumberOfScans"); + + self.scanSpreadAngle = self.ParticleSpreadRange; --Degrees! +end + +function Update(self) + + if self:IsActivated() then + if self.ScanTimer:IsPastSimMS(self.scanDelay) then + self.ScanTimer:Reset(); + local actor = MovableMan:GetMOFromID(self.RootID); + if MovableMan:IsActor(actor) then + self.parent = ToActor(actor); + for x = 1, self.numberOfScans do + local angleVariance = (-self.scanSpreadAngle * 0.5) + (math.random() * self.scanSpreadAngle); + local terrHitCount = 0; + local dots = math.floor(self.maxScanRange/self.scanSpacing) + for i = 1, dots do + local checkPos = self.MuzzlePos + Vector((self.scanSpacing * i) * self.FlipFactor, 0):RadRotate(self.RotAngle):DegRotate(angleVariance); + if SceneMan.SceneWrapsX == true then + if checkPos.X > SceneMan.SceneWidth then + checkPos = Vector(checkPos.X - SceneMan.SceneWidth, checkPos.Y); + elseif checkPos.X < 0 then + checkPos = Vector(SceneMan.SceneWidth + checkPos.X, checkPos.Y); + end + end + local terrCheck = SceneMan:GetTerrMatter(checkPos.X, checkPos.Y); + if terrCheck ~= rte.airID then + terrHitCount = terrHitCount + 1; + end + end + local scanLength = math.floor((self.maxScanRange - (self.scanDisruption * (terrHitCount/dots)))/self.scanSpacing); + for i = 1, scanLength do + local checkPos = self.MuzzlePos + Vector((self.scanSpacing * i) * self.FlipFactor, 0):RadRotate(self.RotAngle):DegRotate(angleVariance); + if SceneMan.SceneWrapsX == true then + if checkPos.X > SceneMan.SceneWidth then + checkPos = Vector(checkPos.X - SceneMan.SceneWidth, checkPos.Y); + elseif checkPos.X < 0 then + checkPos = Vector(SceneMan.SceneWidth + checkPos.X, checkPos.Y); + end + end + SceneMan:RevealUnseen(checkPos.X, checkPos.Y, self.parent.Team); + end + end + end + end + end +end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Scanner/ScannerHeavy.lua b/Base.rte/Devices/Tools/Scanner/ScannerHeavy.lua deleted file mode 100644 index 9a0f20bd2..000000000 --- a/Base.rte/Devices/Tools/Scanner/ScannerHeavy.lua +++ /dev/null @@ -1,62 +0,0 @@ -function Create(self) - - self.ScanTimer = Timer(); - self.scanDelay = 100; - self.maxScanRange = 500; - self.scanDisruption = 300; - self.scanSpacing = 10; - - self.numberOfScans = 6; - self.scanSpreadAngle = 30; -- Degrees! - -end - -function Update(self) - - if self:IsActivated() then - if self.ScanTimer:IsPastSimMS(self.scanDelay) then - self.ScanTimer:Reset(); - local actor = MovableMan:GetMOFromID(self.RootID); - if MovableMan:IsActor(actor) then - self.parent = ToActor(actor); - if self.HFlipped == false then - self.negativeNum = 1; - else - self.negativeNum = -1; - end - for x = 1, self.numberOfScans do - local angleVariance = (-self.scanSpreadAngle*0.5) + (math.random()*self.scanSpreadAngle); - local terrHitCount = 0; - local dots = math.floor(self.maxScanRange/self.scanSpacing) - for i = 1, dots do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - local terrCheck = SceneMan:GetTerrMatter(checkPos.X,checkPos.Y); - if terrCheck ~= 0 then - terrHitCount = terrHitCount + 1; - end - end - local scanLength = math.floor((self.maxScanRange-(self.scanDisruption*(terrHitCount/dots)))/self.scanSpacing); - for i = 1, scanLength do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - SceneMan:RevealUnseen(checkPos.X,checkPos.Y,self.parent.Team); - end - end - end - end - end - -end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Scanner/ScannerLight.lua b/Base.rte/Devices/Tools/Scanner/ScannerLight.lua deleted file mode 100644 index c9d5b3aeb..000000000 --- a/Base.rte/Devices/Tools/Scanner/ScannerLight.lua +++ /dev/null @@ -1,62 +0,0 @@ -function Create(self) - - self.ScanTimer = Timer(); - self.scanDelay = 100; - self.maxScanRange = 300; - self.scanDisruption = 200; - self.scanSpacing = 10; - - self.numberOfScans = 2; - self.scanSpreadAngle = 10; -- Degrees! - -end - -function Update(self) - - if self:IsActivated() then - if self.ScanTimer:IsPastSimMS(self.scanDelay) then - self.ScanTimer:Reset(); - local actor = MovableMan:GetMOFromID(self.RootID); - if MovableMan:IsActor(actor) then - self.parent = ToActor(actor); - if self.HFlipped == false then - self.negativeNum = 1; - else - self.negativeNum = -1; - end - for x = 1, self.numberOfScans do - local angleVariance = (-self.scanSpreadAngle*0.5) + (math.random()*self.scanSpreadAngle); - local terrHitCount = 0; - local dots = math.floor(self.maxScanRange/self.scanSpacing) - for i = 1, dots do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - local terrCheck = SceneMan:GetTerrMatter(checkPos.X,checkPos.Y); - if terrCheck ~= 0 then - terrHitCount = terrHitCount + 1; - end - end - local scanLength = math.floor((self.maxScanRange-(self.scanDisruption*(terrHitCount/dots)))/self.scanSpacing); - for i = 1, scanLength do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - SceneMan:RevealUnseen(checkPos.X,checkPos.Y,self.parent.Team); - end - end - end - end - end - -end \ No newline at end of file diff --git a/Base.rte/Devices/Tools/Scanner/ScannerMedium.lua b/Base.rte/Devices/Tools/Scanner/ScannerMedium.lua deleted file mode 100644 index 6904d0c6f..000000000 --- a/Base.rte/Devices/Tools/Scanner/ScannerMedium.lua +++ /dev/null @@ -1,62 +0,0 @@ -function Create(self) - - self.ScanTimer = Timer(); - self.scanDelay = 100; - self.maxScanRange = 400; - self.scanDisruption = 250; - self.scanSpacing = 10; - - self.numberOfScans = 4; - self.scanSpreadAngle = 20; -- Degrees! - -end - -function Update(self) - - if self:IsActivated() then - if self.ScanTimer:IsPastSimMS(self.scanDelay) then - self.ScanTimer:Reset(); - local actor = MovableMan:GetMOFromID(self.RootID); - if MovableMan:IsActor(actor) then - self.parent = ToActor(actor); - if self.HFlipped == false then - self.negativeNum = 1; - else - self.negativeNum = -1; - end - for x = 1, self.numberOfScans do - local angleVariance = (-self.scanSpreadAngle*0.5) + (math.random()*self.scanSpreadAngle); - local terrHitCount = 0; - local dots = math.floor(self.maxScanRange/self.scanSpacing) - for i = 1, dots do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - local terrCheck = SceneMan:GetTerrMatter(checkPos.X,checkPos.Y); - if terrCheck ~= 0 then - terrHitCount = terrHitCount + 1; - end - end - local scanLength = math.floor((self.maxScanRange-(self.scanDisruption*(terrHitCount/dots)))/self.scanSpacing); - for i = 1, scanLength do - local checkPos = self.MuzzlePos + Vector((self.scanSpacing*i)*self.negativeNum,0):RadRotate(self.RotAngle):DegRotate(angleVariance); - if SceneMan.SceneWrapsX == true then - if checkPos.X > SceneMan.SceneWidth then - checkPos = Vector(checkPos.X - SceneMan.SceneWidth,checkPos.Y); - elseif checkPos.X < 0 then - checkPos = Vector(SceneMan.SceneWidth + checkPos.X,checkPos.Y); - end - end - SceneMan:RevealUnseen(checkPos.X,checkPos.Y,self.parent.Team); - end - end - end - end - end - -end \ No newline at end of file diff --git a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle.ini b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle.ini index e93096763..0e3905bc6 100644 --- a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle.ini +++ b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle.ini @@ -40,7 +40,7 @@ AddAmmo = Magazine X = -1 Y = 1 DrawAfterParent = 0 - RoundCount = 5 + RoundCount = 10 RTTRatio = 3 RegularRound = Round CopyOf = Round 7.62x39 @@ -67,7 +67,7 @@ AddDevice = HDFirearm CopyOf = Dent Metal ExitWound = AEmitter CopyOf = Dent Metal - GoldValue = 50 + GoldValue = 40 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material diff --git a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle000.bmp b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle000.bmp index 74b9210c0..ebff0a116 100644 Binary files a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle000.bmp and b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle000.bmp differ diff --git a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle001.bmp b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle001.bmp index 795eba2a0..1208de390 100644 Binary files a/Base.rte/Devices/Weapons/BattleRifle/BattleRifle001.bmp and b/Base.rte/Devices/Weapons/BattleRifle/BattleRifle001.bmp differ diff --git a/Base.rte/Devices/Weapons/Pistol/Pistol.ini b/Base.rte/Devices/Weapons/Pistol/Pistol.ini index 25fea6b5a..14668530b 100644 --- a/Base.rte/Devices/Weapons/Pistol/Pistol.ini +++ b/Base.rte/Devices/Weapons/Pistol/Pistol.ini @@ -120,10 +120,10 @@ AddDevice = HDFirearm ReloadTime = 1500 FullAuto = 0 FireIgnoresThis = 1 - ShakeRange = 13 + ShakeRange = 10 SharpShakeRange = 3 NoSupportFactor = 1.5 - ParticleSpreadRange = 3 + ParticleSpreadRange = 1 ShellSpreadRange = 8 ShellAngVelRange = 2 MuzzleOffset = Vector diff --git a/Base.rte/Devices/Weapons/Pistol/Pistol000.bmp b/Base.rte/Devices/Weapons/Pistol/Pistol000.bmp index dbf4a7ccd..9115e4347 100644 Binary files a/Base.rte/Devices/Weapons/Pistol/Pistol000.bmp and b/Base.rte/Devices/Weapons/Pistol/Pistol000.bmp differ diff --git a/Base.rte/Devices/Weapons/Pistol/Pistol001.bmp b/Base.rte/Devices/Weapons/Pistol/Pistol001.bmp index 00cce9f6f..0955d6457 100644 Binary files a/Base.rte/Devices/Weapons/Pistol/Pistol001.bmp and b/Base.rte/Devices/Weapons/Pistol/Pistol001.bmp differ diff --git a/Base.rte/Devices/Weapons/SMG/SMG.ini b/Base.rte/Devices/Weapons/SMG/SMG.ini index 1b7241c79..bb146ed86 100644 --- a/Base.rte/Devices/Weapons/SMG/SMG.ini +++ b/Base.rte/Devices/Weapons/SMG/SMG.ini @@ -68,14 +68,14 @@ AddDevice = HDFirearm AddToGroup = Weapons AddToGroup = Weapons - Primary AddToGroup = Weapons - Light - Mass = 10 + Mass = 8 HitsMOs = 0 GetsHitByMOs = 1 SpriteFile = ContentFile FilePath = Base.rte/Devices/Weapons/SMG/SMG.bmp FrameCount = 2 SpriteOffset = Vector - X = -7 + X = -8 Y = -4 EntryWound = AEmitter CopyOf = Dent Metal @@ -151,11 +151,11 @@ AddDevice = HDFirearm ShakeRange = 8 SharpShakeRange = 3 NoSupportFactor = 3 - ParticleSpreadRange = 3 + ParticleSpreadRange = 1 ShellSpreadRange = 8 ShellAngVelRange = 2 MuzzleOffset = Vector - X = 10 + X = 9 Y = 0 EjectionOffset = Vector X = 1 diff --git a/Base.rte/Devices/Weapons/SMG/SMG000.bmp b/Base.rte/Devices/Weapons/SMG/SMG000.bmp index e85259c3d..04420884a 100644 Binary files a/Base.rte/Devices/Weapons/SMG/SMG000.bmp and b/Base.rte/Devices/Weapons/SMG/SMG000.bmp differ diff --git a/Base.rte/Devices/Weapons/SMG/SMG001.bmp b/Base.rte/Devices/Weapons/SMG/SMG001.bmp index 4f2a6a612..a6f5b5716 100644 Binary files a/Base.rte/Devices/Weapons/SMG/SMG001.bmp and b/Base.rte/Devices/Weapons/SMG/SMG001.bmp differ diff --git a/Base.rte/Devices/Weapons/Shotgun/Shotgun.ini b/Base.rte/Devices/Weapons/Shotgun/Shotgun.ini index 6ba13dbbc..ec6da2c38 100644 --- a/Base.rte/Devices/Weapons/Shotgun/Shotgun.ini +++ b/Base.rte/Devices/Weapons/Shotgun/Shotgun.ini @@ -4,7 +4,7 @@ AddAmmo = Magazine PresetName = Magazine Shotgun - Mass = 2 + Mass = 1 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile @@ -17,6 +17,8 @@ AddAmmo = Magazine RTTRatio = 0 RegularRound = Round CopyOf = Round Shotgun + PresetName = Round Shotgun + Shell = None TracerRound = None Discardable = 0 @@ -30,9 +32,11 @@ AddDevice = HDFirearm HitsMOs = 0 GetsHitByMOs = 1 ScriptPath = Base.rte/Devices/Shared/Scripts/ShotgunReload.lua + ScriptPath = Base.rte/Devices/Weapons/Shotgun/Shotgun.lua SpriteFile = ContentFile FilePath = Base.rte/Devices/Weapons/Shotgun/Shotgun.bmp FrameCount = 2 + IsAnimatedManually = 1 SpriteOffset = Vector X = -9 Y = -6 @@ -65,10 +69,10 @@ AddDevice = HDFirearm Y = 7 SharpStanceOffset = Vector X = 5 - Y = -2 + Y = -1 SupportOffset = Vector X = 4 - Y = 2 + Y = 1 SharpLength = 150 Magazine = Magazine CopyOf = Magazine Shotgun diff --git a/Base.rte/Devices/Weapons/Shotgun/Shotgun.lua b/Base.rte/Devices/Weapons/Shotgun/Shotgun.lua new file mode 100644 index 000000000..17406c501 --- /dev/null +++ b/Base.rte/Devices/Weapons/Shotgun/Shotgun.lua @@ -0,0 +1,49 @@ +function Create(self) + self.pullTimer = Timer(); + self.loaded = false; + self.rotFactor = math.pi; +end +function Update(self) + local parent; + local actor = self:GetRootParent(); + if actor and IsAHuman(actor) then + parent = ToAHuman(actor); + end + if self.FiredFrame then + self.shell = CreateMOSParticle("Base.rte/Shell"); + self.loaded = false; + self.playedSound = false; + self.rotFactor = math.pi; + end + if parent and not self.loaded and self.RoundInMagCount > 0 and not self.reloadCycle then + self:Deactivate(); + if self.pullTimer:IsPastSimMS(15000/self.RateOfFire) then + if not self.playedSound then + AudioMan:PlaySound("Base.rte/Sounds/Devices/ChamberRound.wav", self.Pos); + self.playedSound = true; + end + if self.shell then + self.shell.Pos = self.Pos; + self.shell.Vel = self.Vel + Vector(-6 * self.FlipFactor, -4):RadRotate(self.RotAngle); + self.shell.Team = self.Team; + MovableMan:AddParticle(self.shell); + self.shell = nil; + end + self.Frame = 1; + self.SupportOffset = Vector(1, 2); + local rotTotal = math.sin(self.rotFactor)/5; + self.RotAngle = self.RotAngle + self.FlipFactor * rotTotal; + local jointOffset = Vector(self.JointOffset.X * self.FlipFactor, self.JointOffset.Y):RadRotate(self.RotAngle); + self.Pos = self.Pos - jointOffset + Vector(jointOffset.X, jointOffset.Y):RadRotate(-rotTotal * self.FlipFactor); + self.rotFactor = self.rotFactor - math.pi * 0.0005 * self.RateOfFire; + end + if self.rotFactor <= 0 then + self.loaded = true; + self.Frame = 0; + self.SupportOffset = Vector(4, 1); + self.rotFactor = 0; + end + else + self.pullTimer:Reset(); + end +end \ No newline at end of file diff --git a/Base.rte/Devices/Weapons/Shotgun/Shotgun000.bmp b/Base.rte/Devices/Weapons/Shotgun/Shotgun000.bmp index 232435a01..70ef3482c 100644 Binary files a/Base.rte/Devices/Weapons/Shotgun/Shotgun000.bmp and b/Base.rte/Devices/Weapons/Shotgun/Shotgun000.bmp differ diff --git a/Base.rte/Devices/Weapons/Shotgun/Shotgun001.bmp b/Base.rte/Devices/Weapons/Shotgun/Shotgun001.bmp index cf6ea0e7f..b87399da8 100644 Binary files a/Base.rte/Devices/Weapons/Shotgun/Shotgun001.bmp and b/Base.rte/Devices/Weapons/Shotgun/Shotgun001.bmp differ diff --git a/Base.rte/Effects.ini b/Base.rte/Effects.ini index d2c53dbf4..42bec69c8 100644 --- a/Base.rte/Effects.ini +++ b/Base.rte/Effects.ini @@ -186,9 +186,9 @@ AddEffect = MOPixel PresetName = Grenade Fragment Yellow Mass = 0.15 LifeTime = 200 - Sharpness = 22 - AirResistance = 0.05 - WoundDamageMultiplier = 1.3 + Sharpness = 30 + AirResistance = 0.075 + WoundDamageMultiplier = 1.1 HitsMOs = 1 GetsHitByMOs = 0 Color = Color @@ -320,7 +320,6 @@ AddEffect = MOPixel TrailLength = 2 ScreenEffect = ContentFile FilePath = Base.rte/Effects/Glows/FireGlowTiny.bmp - EffectStartTime = 0 /////////////////////////////////////////////////////////////////////// @@ -417,7 +416,7 @@ AddEffect = MOPixel PresetName = Jet Air Blast Mass = 15 LifeTime = 45 - Sharpness = 0.3 + Sharpness = 0.2 HitsMOs = 1 GetsHitByMOs = 0 Color = Color diff --git a/Base.rte/Effects/Glows/FireGlow2.bmp b/Base.rte/Effects/Glows/FireGlow2.bmp index 68c3c533f..f2cf03f40 100644 Binary files a/Base.rte/Effects/Glows/FireGlow2.bmp and b/Base.rte/Effects/Glows/FireGlow2.bmp differ diff --git a/Base.rte/Effects/Pyro.ini b/Base.rte/Effects/Pyro.ini index 82e167ea4..c949c62f8 100644 --- a/Base.rte/Effects/Pyro.ini +++ b/Base.rte/Effects/Pyro.ini @@ -616,7 +616,7 @@ AddEffect = MOSParticle PresetName = Main Thruster Blast Ball 1 Mass = 9 GlobalAccScalar = -0.05 - AirResistance = 0.002 + AirResistance = 0.01 RestThreshold = -1 LifeTime = 300 Sharpness = 0.1 @@ -692,6 +692,7 @@ AddEffect = MOSParticle AddEffect = AEmitter PresetName = Fuel Fire Trace Gray LifeTime = 200 + AirResistance = 0.1 Mass = 0.1 HitsMOs = 0 GetsHitByMOs = 0 @@ -774,6 +775,12 @@ AddEffect = AEmitter FlashOnlyOnBurst = 0 +AddEffect = AEmitter + CopyOf = Fuel Fire Trace Gray + PresetName = Ship Explosion + LifeTime = 150 + + AddEffect = PEmitter PresetName = Fuel Fire Trace Black LifeTime = 150 @@ -981,14 +988,14 @@ AddEffect = AEmitter AddAmmo = MOSRotating PresetName = Flame Ball 1 - LifeTime = 150 + LifeTime = 200 Mass = 2 RestThreshold = -1 Sharpness = 1 HitsMOs = 1 GetsHitByMOs = 0 SpriteFile = ContentFile - FilePath = Base.rte/Effects/Pyro/Flame/FlameBall00.bmp + FilePath = Base.rte/Effects/Pyro/Flame/FlameBall.bmp FrameCount = 14 SpriteOffset = Vector X = -10 @@ -1065,9 +1072,9 @@ AddEffect = MOSParticle FilePath = Base.rte/Effects/Glows/FireGlow1.bmp EffectAlwaysShows = 0 EffectStartTime = 0 - EffectStopTime = 6000 - EffectStartStrength = 0.5 - EffectStopStrength = 0.1 + EffectStopTime = 5000 + EffectStartStrength = 0.4 + EffectStopStrength = 0.0 RandomizeEffectRotAngle = 1 @@ -1076,8 +1083,8 @@ AddEffect = MOSParticle PresetName = Flame 2 Hurt ScreenEffect = ContentFile FilePath = Base.rte/Effects/Glows/FireGlow1.bmp - EffectStopTime = 4000 - EffectStartStrength = 0.75 + EffectStopTime = 3000 + EffectStartStrength = 0.6 EffectStopStrength = 0.0 @@ -1370,7 +1377,7 @@ AddAmmo = MOSParticle AddAmmo = MOSParticle CopyOf = Small Smoke Ball 1 PresetName = Grenade Smoke 2 - LifeTime = 400 + LifeTime = 500 Mass = 0.1 Sharpness = 0.01 HitsMOs = 0 @@ -1454,20 +1461,22 @@ AddEffect = AEmitter AddEffect = MOSParticle CopyOf = Tiny Smoke Ball 1 PresetName = Tiny Smoke Trail 1 - LifeTime = 160 - GlobalAccScalar = -0.2 + LifeTime = 200 + GlobalAccScalar = -0.1 + AirResistance = 0.3 + AirThreshold = 3 AddEffect = MOSParticle CopyOf = Tiny Smoke Trail 1 PresetName = Tiny Smoke Trail 2 - LifeTime = 140 - + LifeTime = 175 + AddEffect = MOSParticle CopyOf = Tiny Smoke Trail 1 - PresetName = Tiny Smoke Trail 3 - LifeTime = 120 + PresetName = Tiny Smoke Trail 2 + LifeTime = 150 AddAmmo = AEmitter @@ -1480,7 +1489,6 @@ AddAmmo = AEmitter FilePath = Base.rte/Null.bmp AtomGroup = AtomGroup CopyOf = Null AtomGroup - BurstTriggered = 1 AddEmission = Emission EmittedParticle = MOSParticle CopyOf = Tiny Smoke Ball 1 @@ -1509,8 +1517,7 @@ AddAmmo = AEmitter BurstScale = 1 BurstTriggered = 1 EmissionDamage = 0 - Flash = None - FlashOnlyOnBurst = 0 + GibImpulseLimit = 0 AddAmmo = AEmitter @@ -1523,7 +1530,6 @@ AddAmmo = AEmitter FilePath = Base.rte/Null.bmp AtomGroup = AtomGroup CopyOf = Null AtomGroup - BurstTriggered = 1 AddEmission = Emission EmittedParticle = MOSParticle CopyOf = Flame Smoke 1 @@ -1616,5 +1622,4 @@ AddAmmo = AEmitter BurstScale = 1 BurstTriggered = 1 EmissionDamage = 0 - Flash = None - FlashOnlyOnBurst = 0 \ No newline at end of file + GibImpulseLimit = 0 \ No newline at end of file diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB009.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB009.bmp index 156d5b794..4efba399c 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB009.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB009.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB010.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB010.bmp index ec99f50a3..1f969618b 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB010.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB010.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB011.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB011.bmp index e47e220ed..6c9a2e8b5 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB011.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB011.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB012.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB012.bmp index b8c273280..dec647f2a 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB012.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB012.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB013.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB013.bmp index 86f7b2dfb..a8f7f5009 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB013.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB013.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB014.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB014.bmp index 6b7532288..20f933df3 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB014.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB014.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB015.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB015.bmp index 9a5da5ff3..82453470e 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB015.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB015.bmp differ diff --git a/Base.rte/Effects/Pyro/FireBlastSmallB018.bmp b/Base.rte/Effects/Pyro/FireBlastSmallB018.bmp index ba0a531be..22b1443b3 100644 Binary files a/Base.rte/Effects/Pyro/FireBlastSmallB018.bmp and b/Base.rte/Effects/Pyro/FireBlastSmallB018.bmp differ diff --git a/Base.rte/Effects/Pyro/Flame/Flame.lua b/Base.rte/Effects/Pyro/Flame/Flame.lua index fa168d544..d7274c82f 100644 --- a/Base.rte/Effects/Pyro/Flame/Flame.lua +++ b/Base.rte/Effects/Pyro/Flame/Flame.lua @@ -13,7 +13,7 @@ end function Update(self) self.ToSettle = false; if not self.notSticky then - if self.target and IsMOSRotating(self.target) then + if self.target and self.target.ID ~= rte.NoMOID then self.Vel = self.target.Vel; self.Pos = self.target.Pos + Vector(self.stickPos.X, self.stickPos.Y):RadRotate(self.target.RotAngle - self.targetStickAngle); local actor = MovableMan:GetMOFromID(self.target.RootID); @@ -22,12 +22,14 @@ function Update(self) if math.random() < (self.strength * self.target.DamageMultiplier) / (actor.Mass + self.target.Material.StructuralIntegrity) then actor.Health = actor.Health - 1; end + --Stop, drop and roll! + self.Lifetime = self.Lifetime - math.abs(actor.AngularVel); end else self.target = nil; if self.checkTimer:IsPastSimMS(self.checkDelay) then self.checkTimer:Reset(); - self.checkDelay = self.checkDelay + 3; -- Gradually extend the delay for optimization reasons + self.checkDelay = self.checkDelay + 3; --Gradually extend the delay for optimization reasons local checkPos = self.Pos + self.Vel * rte.PxTravelledPerFrame * math.random(); local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y); if moCheck ~= rte.NoMOID then @@ -50,22 +52,22 @@ function Update(self) end end end - local age = (self.Age * 0.0001) + 1; -- Have age slightly affect particle settings relative to 10 seconds + local age = (self.Age * 0.0001) + 1; --Have age slightly affect particle settings relative to 10 seconds local chance = math.random(); local particle; - if chance < (0.1 / age) then + if chance < (0.1/age) then particle = CreateMOPixel("Ground Fire Burn Particle"); particle.Vel = self.Vel + Vector(RangeRand(-15, 15), -math.random(-10, 20)); particle.Sharpness = particle.Sharpness * RangeRand(0.5, 1.0); - elseif chance < (0.5 / age) then - -- Spawn another, shorter flame particle occasionally + elseif chance < (0.5/age) then + --Spawn another, shorter flame particle occasionally if not self.isShort and math.random() < 0.05 then particle = CreateMOSParticle("Flame Hurt Short Float"); - particle.Lifetime = 4000 / age; + particle.Lifetime = 4000/age; particle.Vel = self.Vel + Vector(0, -3); else particle = CreateMOSParticle("Flame Smoke 2"); - particle.Lifetime = math.random(250, 1000) / age; + particle.Lifetime = math.random(250, 1000)/age; particle.Vel = self.Vel + Vector(0, -1); end particle.Vel = particle.Vel + Vector(math.random(), 0):RadRotate(math.random() * 6.28); diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00000.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall000.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00000.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall000.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00001.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall001.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00001.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall001.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00002.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall002.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00002.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall002.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00003.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall003.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00003.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall003.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00004.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall004.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00004.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall004.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00005.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall005.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00005.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall005.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00006.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall006.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00006.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall006.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00007.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall007.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00007.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall007.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00008.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall008.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00008.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall008.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00009.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall009.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00009.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall009.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00010.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall010.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00010.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall010.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00011.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall011.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00011.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall011.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00012.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall012.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00012.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall012.bmp diff --git a/Base.rte/Effects/Pyro/Flame/FlameBall00013.bmp b/Base.rte/Effects/Pyro/Flame/FlameBall013.bmp similarity index 100% rename from Base.rte/Effects/Pyro/Flame/FlameBall00013.bmp rename to Base.rte/Effects/Pyro/Flame/FlameBall013.bmp diff --git a/Base.rte/Effects/Wounds.ini b/Base.rte/Effects/Wounds.ini index 572855a4a..d84aff7bc 100644 --- a/Base.rte/Effects/Wounds.ini +++ b/Base.rte/Effects/Wounds.ini @@ -66,7 +66,7 @@ AddEffect = MOPixel AddEffect = MOSParticle PresetName = Blood Spray Particle RestThreshold = -1 - Mass = 0 + Mass = 0.1 LifeTime = 300 Sharpness = 0.1 AirResistance = 0.02 @@ -466,8 +466,6 @@ AddEffect = AEmitter BurstDamage = 2 BurstTriggered = 1 EmissionDamage = 0.12 - Flash = None - FlashOnlyOnBurst = 0 AddEffect = AEmitter @@ -817,8 +815,9 @@ AddEffect = AEmitter Spread = 0.3 MaxVelocity = 6 MinVelocity = 3 - EmissionCountLimit = 100 - EmissionDamage = 0.05 + EmissionCountLimit = 160 + EmissionDamage = 0.08 + BurstDamage = 3 AddEffect = AEmitter @@ -856,12 +855,14 @@ AddEffect = AEmitter AddEmission = Emission EmittedParticle = MOPixel CopyOf = Spark Yellow 1 - Spread = 0.2 - MaxVelocity = 6 - MinVelocity = 3 + LifeVariation = 0.20 + Spread = 0.1 + MaxVelocity = 12 + MinVelocity = 9 AddEmission = Emission EmittedParticle = MOPixel CopyOf = Spark Yellow 2 + LifeVariation = 0.20 Spread = 0.2 MaxVelocity = 6 MinVelocity = 3 @@ -870,7 +871,7 @@ AddEffect = AEmitter EmissionEnabled = 1 EmissionsIgnoreThis = 1 ParticlesPerMinute = 0 - BurstSize = 10 + BurstSize = 9 BurstScale = 4 BurstDamage = 1 BurstTriggered = 1 diff --git a/Base.rte/Materials.ini b/Base.rte/Materials.ini index 771737836..3bf9a2c41 100644 --- a/Base.rte/Materials.ini +++ b/Base.rte/Materials.ini @@ -284,7 +284,7 @@ AddMaterial = Material PresetName = Dense Red Earth Bounce = 0.1 Friction = 0.85 - StructuralIntegrity = 80 + StructuralIntegrity = 90 DensityKGPerVolumeL = 2.0 GibImpulseLimitPerVolumeL = 15 GibWoundLimitPerVolumeL = 0.1 @@ -302,7 +302,7 @@ AddMaterial = Material PresetName = Red Earth Bounce = 0.1 Friction = 0.85 - StructuralIntegrity = 60 + StructuralIntegrity = 70 DensityKGPerVolumeL = 2.0 GibImpulseLimitPerVolumeL = 15 GibWoundLimitPerVolumeL = 0.1 @@ -318,7 +318,7 @@ AddMaterial = Material PresetName = Red Stone Bounce = 0.6 Friction = 0.9 - StructuralIntegrity = 100 + StructuralIntegrity = 110 DensityKGPerVolumeL = 2.5 GibImpulseLimitPerVolumeL = 15 GibWoundLimitPerVolumeL = 0.1 @@ -622,7 +622,7 @@ AddMaterial = Material PresetName = Kevlared Flesh Bounce = 0.6 Friction = 0.6 - StructuralIntegrity = 45 + StructuralIntegrity = 50 DensityKGPerVolumeL = 1.4 GibImpulseLimitPerVolumeL = 22 GibWoundLimitPerVolumeL = 0.2 @@ -640,7 +640,7 @@ AddMaterial = Material PresetName = Armoured Flesh Bounce = 0.6 Friction = 0.6 - StructuralIntegrity = 50 + StructuralIntegrity = 55 DensityKGPerVolumeL = 2.5 GibImpulseLimitPerVolumeL = 30 GibWoundLimitPerVolumeL = 0.3 @@ -822,7 +822,7 @@ AddMaterial = Material GibImpulseLimitPerVolumeL = 15 GibWoundLimitPerVolumeL = 0.1 Priority = 10 - SettleMaterial = 182 + SettleMaterial = 180 Color = Color R = 185 G = 195 @@ -838,7 +838,7 @@ AddMaterial = Material GibImpulseLimitPerVolumeL = 15 GibWoundLimitPerVolumeL = 0.1 Priority = 10 - SettleMaterial = 182 + SettleMaterial = 180 Color = Color R = 220 G = 235 diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikeEmitter.lua b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikeEmitter.lua new file mode 100644 index 000000000..aff82474e --- /dev/null +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikeEmitter.lua @@ -0,0 +1,27 @@ +function Create(self) + self.Team = Activity.NOTEAM; + self.IgnoresTeamHits = false; + + self.updateTimer = Timer(); + self.updateTimer:SetSimTimeLimitMS(math.random(900, 1000)); + + self.materialID = SceneMan:GetTerrMatter(self.Pos.X, self.Pos.Y); +end +function Update(self) + --Check if the terrain piece still exists and delete the emitter if it does not + if self.updateTimer:IsPastSimTimeLimit() then + self.updateTimer:Reset(); + local terrainFound = false; + local checkPosY = {-2, 0, 2}; + for i = 1, #checkPosY do + local checkPos = self.Pos + Vector(0, checkPosY[i]):RadRotate(self.RotAngle); + if SceneMan:GetTerrMatter(checkPos.X, checkPos.Y) == self.materialID then + terrainFound = true; + break; + end + end + if not terrainFound then + self:GibThis(); + end + end +end \ No newline at end of file diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes.ini b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes.ini new file mode 100644 index 000000000..49429a1d6 --- /dev/null +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes.ini @@ -0,0 +1,136 @@ +/////////////////////////////////////////////////////////////////////// +// Spikes + + +AddEffect = MOPixel + PresetName = Spike Particle + Mass = 1 + RestThreshold = -1 + Sharpness = 20 + GlobalAccScalar = -1 + WoundDamageMultiplier = 5 + IgnoresTeamHits = 0 + HitsMOs = 1 + GetsHitByMOs = 0 + LifeTime = 20 + Color = Color + R = 255 + G = 0 + B = 255 + Atom = Atom + Material = Material + CopyOf = Air Blast + TrailColor = Color + R = 37 + G = 43 + B = 50 + TrailLength = 0 + + +AddTerrainObject = TerrainObject + PresetName = Spikes + AddToGroup = Bunker Bits + GoldValue = 50 + FGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesFG.bmp + MaterialFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesMat.bmp + BGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesBG.bmp + BitmapOffset = Vector + X = 0 + Y = 0 + AddChildObject = SOPlacer + PlacedObject = AEmitter + PresetName = Spike Emitter + Mass = 1 + PinStrength = 1000 + RestThreshold = -1 + HitsMOs = 0 + GetsHitByMOs = 1 + ScriptPath = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikeEmitter.lua + SpriteFile = ContentFile + FilePath = Base.rte/Null.bmp + FrameCount = 1 + AtomGroup = AtomGroup + CopyOf = Null AtomGroup + GibSound = SoundContainer + CopyOf = Metal Penetration Hit + AddEmission = Emission + EmittedParticle = MOPixel + CopyOf = Spike Particle + ParticlesPerMinute = 2000 + Spread = 0.1 + MaxVelocity = 1 + MinVelocity = 0 + EmissionAngle = Matrix + AngleDegrees = 90 + EmissionEnabled = 1 + EmissionOffset = Vector + X = 0 + Y = -5 + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Grey Micro A + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Grey Tiny A + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Dark Micro A + AddGib = Gib + GibParticle = MOSParticle + CopyOf = Gib Metal Dark Tiny A + AddGib = Gib + GibParticle = MOPixel + CopyOf = Spark Yellow 1 + Count = 5 + Spread = 3.14 + MaxVelocity = 30 + MinVelocity = 15 + LifeVariation = 0.25 + Offset = Vector + X = 4 + Y = 10 + AddChildObject = SOPlacer + PlacedObject = AEmitter + CopyOf = Spike Emitter + Offset = Vector + X = 12 + Y = 10 + AddChildObject = SOPlacer + PlacedObject = AEmitter + CopyOf = Spike Emitter + Offset = Vector + X = 20 + Y = 10 + + +AddTerrainObject = TerrainObject + CopyOf = Spikes + PresetName = Spikes 2X + GoldValue = 100 + FGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XFG.bmp + MaterialFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XMat.bmp + BGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XBG.bmp + AddChildObject = SOPlacer + PlacedObject = AEmitter + CopyOf = Spike Emitter + Offset = Vector + X = 28 + Y = 10 + AddChildObject = SOPlacer + PlacedObject = AEmitter + CopyOf = Spike Emitter + Offset = Vector + X = 36 + Y = 10 + AddChildObject = SOPlacer + PlacedObject = AEmitter + CopyOf = Spike Emitter + Offset = Vector + X = 44 + Y = 10 \ No newline at end of file diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XBG.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XBG.bmp new file mode 100644 index 000000000..e3149b942 Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XBG.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XFG.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XFG.bmp new file mode 100644 index 000000000..41e977f14 Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XFG.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XMat.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XMat.bmp new file mode 100644 index 000000000..1f372d636 Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes2XMat.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesBG.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesBG.bmp new file mode 100644 index 000000000..d84e364bd Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesBG.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesFG.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesFG.bmp new file mode 100644 index 000000000..94f486d7a Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesFG.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesMat.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesMat.bmp new file mode 100644 index 000000000..8bc7f087d Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/SpikesMat.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Doors/Doors.ini b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Doors/Doors.ini index 61fdd655f..48a0ce126 100644 --- a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Doors/Doors.ini +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Doors/Doors.ini @@ -284,7 +284,7 @@ AddEffect = Attachable Resolution = 6 Depth = 4 DeepCheck = 1 - JointStrength = 300 + JointStrength = 400 JointStiffness = 0.5 BreakWound = AEmitter CopyOf = Wound Bone Break @@ -293,7 +293,7 @@ AddEffect = Attachable Y = 0 DrawAfterParent = 1 GibImpulseLimit = 5000 - GibWoundLimit = 100 + GibWoundLimit = 150 // GibSound = SoundContainer // CopyOf = Bone Crack AddGib = Gib @@ -415,7 +415,7 @@ AddEffect = Attachable Resolution = 6 Depth = 4 DeepCheck = 1 - JointStrength = 300 + JointStrength = 400 JointStiffness = 0.5 BreakWound = AEmitter CopyOf = Wound Bone Break @@ -424,7 +424,7 @@ AddEffect = Attachable Y = 0 DrawAfterParent = 0 GibImpulseLimit = 5000 - GibWoundLimit = 100 + GibWoundLimit = 150 // GibSound = SoundContainer // CopyOf = Bone Crack AddGib = Gib @@ -559,7 +559,7 @@ AddEffect = Attachable Resolution = 6 Depth = 4 DeepCheck = 1 - JointStrength = 300 + JointStrength = 600 JointStiffness = 0.5 BreakWound = AEmitter CopyOf = Wound Bone Break @@ -568,7 +568,7 @@ AddEffect = Attachable Y = 0 DrawAfterParent = 0 GibImpulseLimit = 5000 - GibWoundLimit = 112 + GibWoundLimit = 250 // GibSound = SoundContainer // CopyOf = Bone Crack AddGib = Gib @@ -713,7 +713,7 @@ AddEffect = Attachable Resolution = 6 Depth = 4 DeepCheck = 1 - JointStrength = 300 + JointStrength = 600 JointStiffness = 0.5 BreakWound = AEmitter CopyOf = Wound Bone Break @@ -722,7 +722,7 @@ AddEffect = Attachable Y = 0 DrawAfterParent = 0 GibImpulseLimit = 5000 - GibWoundLimit = 112 + GibWoundLimit = 250 // GibSound = SoundContainer // CopyOf = Bone Crack AddGib = Gib @@ -911,7 +911,7 @@ AddEffect = ADoor AddSound = ContentFile FilePath = Base.rte/Sounds/DoorChangeDirection.wav GibImpulseLimit = 5000 - GibWoundLimit = 35 + GibWoundLimit = 100 AddGib = Gib GibParticle = MOSRotating CopyOf = Door Motor Gib A diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderBG.lua b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderBG.lua new file mode 100644 index 000000000..4cae6d74f --- /dev/null +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderBG.lua @@ -0,0 +1,73 @@ +function Create(self) + self.skipFrames = 2; + self.checkDelay = math.ceil(self.skipFrames * TimerMan.DeltaTimeMS); + self.idleDelay = self.checkDelay * 5; + self.checkTimer = Timer(); + self.checkTimer:SetSimTimeLimitMS(self.idleDelay); + self.checkCounter = 0; + self.idleCheckLimit = 50; + + self.checkPos = self.Pos; + + self.width = (ToMOSprite(self):GetSpriteWidth()/5) - 1; + self.height = (ToMOSprite(self):GetSpriteHeight()/3) - 1; + + self.gib = CreateTerrainObject("Destroyed Background Ladder"); + self.gib.Pos = Vector(self.Pos.X, self.Pos.Y); +end +function Update(self) + if self.PinStrength ~= 0 then + if self.checkTimer:IsPastSimTimeLimit() then + self.checkTimer:Reset(); + self.Vel, self.AngularVel = Vector(), 0; + local moCheck = SceneMan:GetMOIDPixel(self.checkPos.X, self.checkPos.Y); + local actor; + if moCheck ~= rte.NoMOID then + local mo = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck).RootID); + if mo and IsAHuman(mo) then + actor = ToAHuman(MovableMan:GetMOFromID(mo.RootID)); + local controller = actor:GetController(); + local limbs = actor.FGLeg or actor.BGLeg or actor.FGArm or actor.BGArm; + if limbs and actor.Status == Actor.STABLE and not controller:IsState(Controller.BODY_JUMP) then + local velFactor = 1 + actor.Vel.Magnitude * 0.3; + local aimAngle = actor:GetAimAngle(false); + local climb = false; + -- Climb by looking up/down or moving + if (aimAngle > 1.5 and controller:IsState(Controller.MOVE_UP)) or (aimAngle < -1.5 and controller:IsState(Controller.MOVE_DOWN)) then + climb = true; + end + local gravity = SceneMan.GlobalAcc * TimerMan.DeltaTimeSecs; + if climb or (controller:IsState(Controller.MOVE_LEFT) or controller:IsState(Controller.MOVE_RIGHT)) then + local speed = actor:GetLimbPathSpeed(1)/velFactor; + actor.Vel = actor.Vel * (1 - 1/velFactor) + Vector(speed, 0):RadRotate(actor:GetAimAngle(true)) - gravity * (0.4 + self.skipFrames/velFactor); + elseif actor.Vel.Magnitude < 5 then + -- Counter gravity to keep actor still + actor.Vel = Vector() - gravity * (0.4 + self.skipFrames/velFactor); + end + end + end + else + self.checkPos = self.Pos + Vector(math.random(-self.width, self.width), math.random(-self.height, self.height)); + end + -- Go into a less frequent "idle" mode after enough empty checks + if actor then + self.checkCounter = self.idleCheckLimit; + self.checkTimer:SetSimTimeLimitMS(self.checkDelay); + elseif self.checkCounter ~= 0 then + self.checkCounter = self.checkCounter - 1; + if self.checkCounter <= 0 then + self.checkCounter = 0; + self.checkTimer:SetSimTimeLimitMS(self.idleDelay); + end + end + end + else + self.ToDelete = true; + end +end +function Destroy(self) + -- If this MO is somehow deleted, a new background sprite will indicate the destruction of the ladder + if self.gib then + SceneMan:AddTerrainObject(self.gib); + end +end \ No newline at end of file diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBG.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBG.bmp new file mode 100644 index 000000000..22d78d39b Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBG.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBGDestroyed.bmp b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBGDestroyed.bmp new file mode 100644 index 000000000..73220468b Binary files /dev/null and b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBGDestroyed.bmp differ diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderNode.lua b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderNode.lua index 44247d31a..a39a3324c 100644 --- a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderNode.lua +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderNode.lua @@ -1,8 +1,8 @@ function Create(self) self.checkTimer = Timer(); self.checkTimer:SetSimTimeLimitMS(51); - self.width = (ToMOSprite(self):GetSpriteWidth() / 2) - 1; - self.height = (ToMOSprite(self):GetSpriteHeight() / 2) - 1; + self.width = (ToMOSprite(self):GetSpriteWidth()/2) - 1; + self.height = (ToMOSprite(self):GetSpriteHeight()/2) - 1; end function Update(self) if self.PinStrength > 0 and self.checkTimer:IsPastSimTimeLimit() then @@ -11,18 +11,19 @@ function Update(self) self.Vel, self.AngularVel = Vector(), 0; local checkPos = self.Pos + Vector(self.width * self.FlipFactor, math.random(-self.height, self.height)):RadRotate(self.RotAngle); local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y); - if moCheck ~= 255 then + if moCheck ~= rte.NoMOID then local mo = MovableMan:GetMOFromID(moCheck); if IsAttachable(mo) and ToAttachable(mo):GetParent() and IsAHuman(ToAttachable(mo):GetParent()) then local actor = ToAHuman(MovableMan:GetMOFromID(mo.RootID)); - local controller, velFactor = actor:GetController(), 1 + actor.Vel.Magnitude * 0.3; + local controller = actor:GetController(); + local velFactor = 1 + actor.Vel.Magnitude * 0.3; if actor.Status == Actor.STABLE and actor.FlipFactor ~= self.FlipFactor and not controller:IsState(Controller.BODY_JUMP) then - actor.Vel = actor.Vel * (1 - 1 / velFactor); + actor.Vel = actor.Vel * (1 - 1/velFactor); if controller:IsState(Controller.MOVE_LEFT) or controller:IsState(Controller.MOVE_RIGHT) then - local speed = actor:GetLimbPathSpeed(1) / velFactor; - actor.Vel = actor.Vel + Vector(speed / 2, 0):RadRotate(actor:GetAimAngle(true)) - Vector(0, speed); + local speed = actor:GetLimbPathSpeed(1)/velFactor; + actor.Vel = actor.Vel + Vector(speed/2, 0):RadRotate(actor:GetAimAngle(true)) - Vector(0, speed); elseif controller:IsState(Controller.BODY_CROUCH) then - actor.Vel = actor.Vel / 2; + actor.Vel = actor.Vel/2; end end end diff --git a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/Ladders.ini b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/Ladders.ini index 8b7782be2..80584be8a 100644 --- a/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/Ladders.ini +++ b/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/Ladders.ini @@ -88,6 +88,25 @@ AddActor = MOSRotating CopyOf = Robot Death +AddActor = MOSRotating + PresetName = Background Ladder Node + PinStrength = 1000 + MissionCritical = 1 + Mass = 0 + RestThreshold = 0 + HitsMOs = 0 + GetsHitByMOs = 0 + SpriteFile = ContentFile + FilePath = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/Empty1XFG.bmp + FrameCount = 1 + SpriteOffset = Vector + X = -12 + Y = -12 + ScriptPath = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderBG.lua + AtomGroup = AtomGroup + CopyOf = Null AtomGroup + + AddTerrainObject = TerrainObject PresetName = Powered Ladder Left Description = Having trouble climbing regular ladders? This model will offer you the vertical assistance you need. @@ -131,4 +150,38 @@ AddTerrainObject = TerrainObject X = 12 Y = 12 HFlipped = 1 - \ No newline at end of file + + +AddTerrainObject = TerrainObject + PresetName = Background Ladder + AddToGroup = Bunker Systems + GoldValue = 10 + FGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/Empty1XFG.bmp + MaterialFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/Empty1XMat.bmp + BGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBG.bmp + BitmapOffset = Vector + X = 0 + Y = 0 + AddChildObject = SOPlacer + PlacedObject = MOSRotating + CopyOf = Background Ladder Node + Offset = Vector + X = 12 + Y = 12 + + +AddTerrainObject = TerrainObject + PresetName = Destroyed Background Ladder + Buyable = 0 + FGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/Empty1XFG.bmp + MaterialFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/Empty1XMat.bmp + BGColorFile = ContentFile + Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Ladders/LadderCBGDestroyed.bmp + BitmapOffset = Vector + X = -12 + Y = -12 \ No newline at end of file diff --git a/Base.rte/Scenes/Objects/Bunkers/Bunkers.ini b/Base.rte/Scenes/Objects/Bunkers/Bunkers.ini index 86eeef3f3..2073e93da 100644 --- a/Base.rte/Scenes/Objects/Bunkers/Bunkers.ini +++ b/Base.rte/Scenes/Objects/Bunkers/Bunkers.ini @@ -5,6 +5,7 @@ // Bits and Pieces IncludeFile = Base.rte/Scenes/Objects/Bunkers/BunkerBits/BunkerBits.ini +IncludeFile = Base.rte/Scenes/Objects/Bunkers/BunkerBits/Spikes/Spikes.ini IncludeFile = Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/BunkerBackgrounds.ini diff --git a/Base.rte/Scripts/AirBlast.lua b/Base.rte/Scripts/AirBlast.lua index 25807f60a..a82836049 100644 --- a/Base.rte/Scripts/AirBlast.lua +++ b/Base.rte/Scripts/AirBlast.lua @@ -13,10 +13,18 @@ function Update(self) if strSumCheck < self.strength then local massFactor = math.sqrt(1 + math.abs(mo.Mass)); local distFactor = 1 + dist.Magnitude * 0.1; - local forceVector = dist:SetMagnitude((self.strength - strSumCheck) /distFactor); - mo.Vel = mo.Vel + forceVector /massFactor; - mo.AngularVel = mo.AngularVel - forceVector.X /(massFactor + math.abs(mo.AngularVel)); + local forceVector = dist:SetMagnitude((self.strength - strSumCheck)/distFactor); + mo.Vel = mo.Vel + forceVector/massFactor; + mo.AngularVel = mo.AngularVel - forceVector.X/(massFactor + math.abs(mo.AngularVel)); mo:AddForce(forceVector * massFactor, Vector()); + -- Add some additional points damage to actors + if IsActor(mo) then + local actor = ToActor(mo); + local impulse = (forceVector.Magnitude * self.strength/massFactor) - actor.ImpulseDamageThreshold; + local damage = impulse/(actor.GibImpulseLimit * 0.1 + actor.Material.StructuralIntegrity * 10); + actor.Health = damage > 0 and actor.Health - damage or actor.Health; + actor.Status = (actor.Status == Actor.STABLE and damage > (actor.Health/2)) and Actor.UNSTABLE or actor.Status; + end end end end diff --git a/Base.rte/Scripts/Shared/FlippedFrame.lua b/Base.rte/Scripts/Shared/FlippedFrame.lua new file mode 100644 index 000000000..d581c37fc --- /dev/null +++ b/Base.rte/Scripts/Shared/FlippedFrame.lua @@ -0,0 +1,4 @@ +--Use this script to display a different sprite frame when facing left, instead of the same sprite mirrored +function Update(self) + self.Frame = self.HFlipped and 1 or 0; +end \ No newline at end of file diff --git a/Base.rte/Scripts/Shared/SmokeTrail.lua b/Base.rte/Scripts/Shared/SmokeTrail.lua index 4067799a3..9625c423f 100644 --- a/Base.rte/Scripts/Shared/SmokeTrail.lua +++ b/Base.rte/Scripts/Shared/SmokeTrail.lua @@ -1,14 +1,19 @@ - +function Create(self) + self.smokeTrailLifeTime = self:NumberValueExists("SmokeTrailLifeTime") and self:GetNumberValue("SmokeTrailLifeTime") or 150; + self.spread = self.Radius/3; +end function Update(self) - local Effect - local Offset = self.Vel*(20*TimerMan.DeltaTimeSecs) -- the effect will be created the next frame so move it one frame backwards towards the barrel + local effect; + local offset = self.Vel * rte.PxTravelledPerFrame; --The effect will be created the next frame so move it one frame backwards towards the barrel - for i = 1, math.floor(self.Vel.Magnitude*0.045) do - Effect = CreateMOSParticle("Tiny Smoke Trail " .. math.random(3), "Base.rte") - if Effect then - Effect.Pos = self.Pos - Offset * i/8 + Vector(RangeRand(-2,2),RangeRand(-2,2)) - Effect.Vel = (self.Vel + Vector(RangeRand(-10,30),RangeRand(-10,10))) / 20 - MovableMan:AddParticle(Effect) + local trailLength = math.floor(offset.Magnitude + 0.5); + for i = 1, trailLength, 6 do + effect = CreateMOSParticle("Tiny Smoke Trail 1", "Base.rte"); + if effect then + effect.Pos = self.Pos - offset * (i/trailLength) + Vector(RangeRand(-1, 1), RangeRand(-1, 1)) * self.spread; + effect.Vel = self.Vel * RangeRand(0.75, 1.0); + effect.Lifetime = self.smokeTrailLifeTime * RangeRand(1.0, 1.5); + MovableMan:AddParticle(effect); end end -end +end \ No newline at end of file diff --git a/Missions.rte/Activities/Dummy Assault.lua b/Missions.rte/Activities/Dummy Assault.lua index 8bc2cf3ee..677cd28a4 100644 --- a/Missions.rte/Activities/Dummy Assault.lua +++ b/Missions.rte/Activities/Dummy Assault.lua @@ -160,12 +160,12 @@ function DummyAssault:UpdateActivity() if MovableMan:GetTeamMOIDCount(Activity.TEAM_2) < rte.DefenderMOIDMax then local actor - if math.random() > 0.05 then - actor = RandomAHuman("Infantry Light", self.CPUTech) + if math.random() > self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.CPUTech)) then + actor = RandomAHuman("Actors - Light", self.CPUTech) if math.random() > 0.5 then actor.AIMode = Actor.AIMODE_BRAINHUNT if math.random() > 0.5 then - actor:AddInventoryItem(RandomHDFirearm("Diggers", self.CPUTech)) + actor:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTech)) end else actor.AIMode = Actor.AIMODE_GOTO diff --git a/Missions.rte/Activities/Maginot.lua b/Missions.rte/Activities/Maginot.lua index 6662f8aeb..0e388952a 100644 --- a/Missions.rte/Activities/Maginot.lua +++ b/Missions.rte/Activities/Maginot.lua @@ -244,9 +244,9 @@ function MaginotMission:UpdateActivity() if math.random() > 0.4 then dummya:AddInventoryItem(RandomTDExplosive("Bombs - Grenades", self.EnemyTech)) else - local digger = RandomHDFirearm("Diggers", self.EnemyTech) + local digger = RandomHDFirearm("Tools - Diggers", self.EnemyTech) if not digger then - digger = RandomHDFirearm("Diggers", "Base.rte") + digger = RandomHDFirearm("Tools - Diggers", "Base.rte") end if digger then dummya:AddInventoryItem(digger) @@ -269,9 +269,9 @@ function MaginotMission:UpdateActivity() if math.random() > 0.4 then dummyb:AddInventoryItem(RandomTDExplosive("Bombs - Grenades", self.EnemyTech)) else - local digger = RandomHDFirearm("Diggers", self.EnemyTech) + local digger = RandomHDFirearm("Tools - Diggers", self.EnemyTech) if not digger then - digger = RandomHDFirearm("Diggers", "Base.rte") + digger = RandomHDFirearm("Tools - Diggers", "Base.rte") end if digger then dummyb:AddInventoryItem(digger) @@ -302,14 +302,14 @@ function MaginotMission:UpdateActivity() if MovableMan:GetTeamMOIDCount(Activity.TEAM_2) <= rte.DefenderMOIDMax then local actor local y = math.random() - if y > 0.05 then + if y > self:GetCrabToHumanSpawnRatio(PresetMan:GetModuleID(self.EnemyTech)) then actor = RandomAHuman("Actors - Light", self.EnemyTech) if actor then actor:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.EnemyTech)) if math.random() > 0.1 then actor:AddInventoryItem(RandomTDExplosive("Bombs - Grenades", self.EnemyTech)) else - actor:AddInventoryItem(RandomHDFirearm("Diggers", self.EnemyTech)) + actor:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.EnemyTech)) end end else diff --git a/Missions.rte/Activities/ZombieCave.lua b/Missions.rte/Activities/ZombieCave.lua index 3609e5d1f..08be1abba 100644 --- a/Missions.rte/Activities/ZombieCave.lua +++ b/Missions.rte/Activities/ZombieCave.lua @@ -143,7 +143,7 @@ function ZombieCaveMission:MakeEnemy(whichMode) passenger:AddInventoryItem(RandomHDFirearm("Weapons - Primary", self.CPUTechName)); passenger:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", self.CPUTechName)); if PosRand() < 0.25 then - passenger:AddInventoryItem(RandomHDFirearm("Diggers", self.CPUTechName)); + passenger:AddInventoryItem(RandomHDFirearm("Tools - Diggers", self.CPUTechName)); end end diff --git a/MuIlaak.rte/Index.ini b/MuIlaak.rte/Index.ini index 5c329ab6d..41ee3861b 100644 --- a/MuIlaak.rte/Index.ini +++ b/MuIlaak.rte/Index.ini @@ -1,5 +1,5 @@ DataModule - ModuleName = Mu-Ilaak Tech + ModuleName = Mu-Ilaak IconFile = ContentFile Path = MuIlaak.rte/ModuleIcon.bmp Description = TBA diff --git a/Uzira.rte/Index.ini b/Uzira.rte/Index.ini index 2195a001d..b0b54d8f7 100644 --- a/Uzira.rte/Index.ini +++ b/Uzira.rte/Index.ini @@ -1,5 +1,5 @@ DataModule - ModuleName = Uzira Tech + ModuleName = Uzira IconFile = ContentFile Path = Uzira.rte/ModuleIcon.bmp Description = TBA