Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit d621979

Browse files
committed
Review changes
1 parent f2602d0 commit d621979

File tree

6 files changed

+29
-55
lines changed

6 files changed

+29
-55
lines changed

Base.rte/AI/HumanFunctions.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ end
5959

6060
function HumanFunctions.DoAutomaticEquip(actor)
6161
--Equip a weapon automatically if the one held by a player is destroyed
62-
if actor.EquippedItem == nil and actor.FGArm and not actor.controller:IsState(Controller.WEAPON_FIRE) then
63-
if (actor:IsPlayerControlled() and actor.InventorySize > 0) or actor:UnequipBGArm() then
64-
actor:EquipFirearm(true);
65-
end
62+
if actor.EquippedItem == nil and not actor.controller:IsState(Controller.WEAPON_FIRE) and (actor:IsPlayerControlled() or actor:UnequipBGArm()) then
63+
actor:EquipFirearm(true);
6664
end
6765
end
6866

Base.rte/Activities/OneManArmy.lua

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,20 @@ function OneManArmy:StartActivity()
7979
local primaryWeapon, secondaryWeapon, throwable, actor;
8080
for entity in module.Presets do
8181
local picked; --Prevent duplicates
82-
if not primaryWeapon and entity.ClassName == "HDFirearm" then
83-
if ToMOSRotating(entity):HasObjectInGroup(primaryGroup)
84-
and ToMOSRotating(entity).IsBuyable then
85-
primaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
86-
picked = true;
87-
end
82+
if not primaryWeapon and entity.ClassName == "HDFirearm" and ToMOSRotating(entity):HasObjectInGroup(primaryGroup) and ToMOSRotating(entity).IsBuyable then
83+
primaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
84+
picked = true;
8885
end
89-
if not picked and not secondaryWeapon and entity.ClassName == "HDFirearm" then
90-
if ToMOSRotating(entity):HasObjectInGroup(secondaryGroup)
91-
and ToMOSRotating(entity).IsBuyable then
92-
secondaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
93-
picked = true;
94-
end
86+
if not picked and not secondaryWeapon and entity.ClassName == "HDFirearm" and ToMOSRotating(entity):HasObjectInGroup(secondaryGroup) and ToMOSRotating(entity).IsBuyable then
87+
secondaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
88+
picked = true;
9589
end
96-
if not picked and not throwable and entity.ClassName == "TDExplosive" then
97-
if ToMOSRotating(entity):HasObjectInGroup("Bombs - Grenades")
98-
and ToMOSRotating(entity).IsBuyable then
99-
throwable = CreateTDExplosive(entity:GetModuleAndPresetName());
100-
picked = true;
101-
end
90+
if not picked and not throwable and entity.ClassName == "TDExplosive" and ToMOSRotating(entity):HasObjectInGroup("Bombs - Grenades") and ToMOSRotating(entity).IsBuyable then
91+
throwable = CreateTDExplosive(entity:GetModuleAndPresetName());
92+
picked = true;
10293
end
103-
if not picked and not actor and entity.ClassName == "AHuman" then
104-
if ToMOSRotating(entity):HasObjectInGroup(actorGroup)
105-
and ToMOSRotating(entity).IsBuyable then
106-
actor = CreateAHuman(entity:GetModuleAndPresetName());
107-
end
94+
if not picked and not actor and entity.ClassName == "AHuman" and ToMOSRotating(entity):HasObjectInGroup(actorGroup) and ToMOSRotating(entity).IsBuyable then
95+
actor = CreateAHuman(entity:GetModuleAndPresetName());
10896
end
10997
end
11098
if actor then

Base.rte/Activities/OneManArmyDiggers.lua

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,20 @@ function OneManArmy:StartActivity()
8181
local primaryWeapon, secondaryWeapon, throwable, actor;
8282
for entity in module.Presets do
8383
local picked; -- Prevent duplicates
84-
if not primaryWeapon and entity.ClassName == "HDFirearm" then
85-
if ToMOSRotating(entity):HasObjectInGroup(primaryGroup)
86-
and ToMOSRotating(entity).IsBuyable then
87-
primaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
88-
picked = true;
89-
end
84+
if not primaryWeapon and entity.ClassName == "HDFirearm" if ToMOSRotating(entity):HasObjectInGroup(primaryGroup) and ToMOSRotating(entity).IsBuyable then
85+
primaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
86+
picked = true;
9087
end
91-
if not picked and not secondaryWeapon and entity.ClassName == "HDFirearm" then
92-
if ToMOSRotating(entity):HasObjectInGroup(secondaryGroup)
93-
and ToMOSRotating(entity).IsBuyable then
94-
secondaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
95-
picked = true;
96-
end
88+
if not picked and not secondaryWeapon and entity.ClassName == "HDFirearm" and ToMOSRotating(entity):HasObjectInGroup(secondaryGroup) and ToMOSRotating(entity).IsBuyable then
89+
secondaryWeapon = CreateHDFirearm(entity:GetModuleAndPresetName());
90+
picked = true;
9791
end
98-
if not picked and not throwable and entity.ClassName == "TDExplosive" then
99-
if ToMOSRotating(entity):HasObjectInGroup("Bombs - Grenades")
100-
and ToMOSRotating(entity).IsBuyable then
101-
throwable = CreateTDExplosive(entity:GetModuleAndPresetName());
102-
picked = true;
103-
end
92+
if not picked and not throwable and entity.ClassName == "TDExplosive" and ToMOSRotating(entity):HasObjectInGroup("Bombs - Grenades") and ToMOSRotating(entity).IsBuyable then
93+
throwable = CreateTDExplosive(entity:GetModuleAndPresetName());
94+
picked = true;
10495
end
105-
if not picked and not actor and entity.ClassName == "AHuman" then
106-
if ToMOSRotating(entity):HasObjectInGroup(actorGroup)
107-
and ToMOSRotating(entity).IsBuyable then
108-
actor = CreateAHuman(entity:GetModuleAndPresetName());
109-
end
96+
if not picked and not actor and entity.ClassName == "AHuman" and ToMOSRotating(entity):HasObjectInGroup(actorGroup) and ToMOSRotating(entity).IsBuyable then
97+
actor = CreateAHuman(entity:GetModuleAndPresetName());
11098
end
11199
end
112100
if actor then

Base.rte/Craft/Shared/AttachableTurret.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function Update(self)
1717
if parent then
1818
--Aim directly away from parent
1919
local posTrace = SceneMan:ShortestDistance(parent.Pos, self.Pos, SceneMan.SceneWrapsX):SetMagnitude(self.searchRange * 0.5);
20-
self.RotAngle = (1.57 * self.verticalFactor + posTrace.AbsRadAngle + (parent.HFlipped and math.pi or 0))/(1 + self.verticalFactor) - self.rotation;
20+
self.RotAngle = (math.pi * 0.5 * self.verticalFactor + posTrace.AbsRadAngle + (parent.HFlipped and math.pi or 0))/(1 + self.verticalFactor) - self.rotation;
2121
if IsActor(parent) then
2222
parent = ToActor(parent);
2323
if parent.Status ~= Actor.STABLE then

Ronin.rte/Devices/Tools/Shovel/Shovel.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Update(self)
3030
local fireVec = Vector(60 * self.FlipFactor, 0):RadRotate(self.RotAngle):RadRotate(0.2 * self.FlipFactor);
3131
for i = 1, particleCount do
3232
--Lua-generated particles that can chip stone
33-
local dig = CreateMOPixel("Particle Ronin Shovel 2");
33+
local dig = CreateMOPixel("Particle Ronin Shovel 2", "Ronin.rte");
3434
dig.Pos = self.MuzzlePos;
3535
dig.Vel = Vector(55 * self.FlipFactor, 0):RadRotate(self.RotAngle + (-0.3 + i * 0.2) * self.FlipFactor);
3636
MovableMan:AddParticle(dig);
@@ -41,7 +41,7 @@ function Update(self)
4141
if moCheck ~= rte.NoMOID then
4242
self.hitSound:Play(self.MuzzlePos);
4343
for i = 1, particleCount do
44-
local damagePar = CreateMOPixel("Smack Particle");
44+
local damagePar = CreateMOPixel("Smack Particle", "Base.rte");
4545
damagePar.Pos = self.MuzzlePos;
4646
damagePar.Vel = Vector(fireVec.X, fireVec.Y):RadRotate((-0.8 + i * 0.4) * self.FlipFactor);
4747
damagePar.Team = self.Team;
@@ -93,7 +93,7 @@ function Update(self)
9393
local particleCount = 3;
9494
local spread = self.AngularVel * TimerMan.DeltaTimeSecs * 0.5;
9595
for i = 0, particleCount - 1 do
96-
local damagePar = CreateMOPixel("Smack Particle");
96+
local damagePar = CreateMOPixel("Smack Particle", "Base.rte");
9797
damagePar.Mass = self.Mass--/particleCount;
9898
damagePar.Sharpness = self.Sharpness-- * particleCount;
9999

Techion.rte/Devices/Weapons/GigaPulsar/GigaPulsar.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Update(self)
1818
self.lastMag.Sharpness = 1;
1919
self.lastMag.Vel = self.lastMag.Vel + Vector(-10 * self.FlipFactor, 0):RadRotate(self.RotAngle);
2020

21-
local effect = CreateAEmitter("Techion Giga Pulsar Magazine Eject Effect");
21+
local effect = CreateAEmitter("Techion Giga Pulsar Magazine Eject Effect", "Techion.rte");
2222
effect.Pos = self.lastMag.Pos;
2323
effect.RotAngle = self.RotAngle;
2424
effect.HFlipped = self.HFlipped;

0 commit comments

Comments
 (0)