Skip to content

Commit

Permalink
Tame the camera shake so that it doesn't make the ui unusable when bi…
Browse files Browse the repository at this point in the history
…g things start stoming around

Make the lootboxes visually apparent as to what they are
Shrink the size of the box and adjust cost down
Increase the amount of supply given per depot as well as increasing the resources stored and decreasing cost by a small amount
Make overseer basic weapon a pulse laser instead of machine gun, dps stays about the same
Decrease cost of scout drone
Balance the shotgun riot tanks some more
  • Loading branch information
ForbodingAngel committed May 23, 2021
1 parent 0892162 commit c1ba8d7
Show file tree
Hide file tree
Showing 28 changed files with 225 additions and 216 deletions.
12 changes: 10 additions & 2 deletions Gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,18 @@ function WeaponDef_Post(name, wDef)

--Potentially fix times when weapons explode without doing damage
if tonumber(wDef.areaofeffect) ~= nil and tonumber(wDef.areaofeffect) <= 25 then
wDef.areaofeffect = 25
if wDef.customparams and wDef.customparams.aoeoverride == true then
wDef.areaofeffect = wDef.areaofeffect
else
wDef.areaofeffect = 25
end
end
if tonumber(wDef.areaofeffect) ~= nil and tonumber(wDef.areaofeffect) <= 25 then
wDef.edgeeffectiveness = 1
if wDef.customparams and wDef.customparams.edgeeffectiveness == true then
wDef.edgeeffectiveness = wDef.edgeeffectiveness
else
wDef.edgeeffectiveness = 1
end
end

--Override map gravity for all weapons
Expand Down
23 changes: 23 additions & 0 deletions LuaRules/Gadgets/weapon_ignore_gibs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if not gadgetHandler:IsSyncedCode() then
return
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function gadget:GetInfo()
return {
name = "Ignore Gibs",
desc = "Makes shrapnel not call ProjectileCreated and ProjectileDestroyed",
author = "GoogleFrog",
date = "3 March 2019",
license = "Public domain",
layer = 0,
enabled = true
}
end

function gadget:Initialize()
Script.SetWatchWeapon(-1, false)
gadgetHandler:RemoveGadget()
end
83 changes: 83 additions & 0 deletions LuaRules/Gadgets/weapon_noexplode_stopper.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if not gadgetHandler:IsSyncedCode() then
return
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function gadget:GetInfo()
return {
name = "Noexplode Stopper",
desc = "Implements noexplodes that do not penetrate shields.",
author = "GoogleFrog",
date = "4 Feb 2012",
license = "None",
layer = 50,
enabled = true
}
end

local passedProjectile = {}
local shieldDamages = {}
local noExplode = {}
for i = 1, #WeaponDefs do
shieldDamages[i] = tonumber(WeaponDefs[i].customParams.shield_damage)
if WeaponDefs[i].noExplode then
noExplode[i] = true
end
end

function gadget:ShieldPreDamaged(proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile)

--[[
-- Code that causes projectile bounce
if Spring.ValidUnitID(shieldCarrierUnitID) then
local px, py, pz = Spring.GetProjectilePosition(proID)
local vx, vy, vz = Spring.GetProjectileVelocity(proID)
local sx, sy, sz = Spring.GetUnitPosition(shieldCarrierUnitID)
local rx, ry, rz = px-sx, py-sy, pz-sz
local f = 2 * (rx*vx + ry*vy + rz*vz) / (rx^2 + ry^2 + rz^2)
local nx, ny, nz = vx - f*rx, vy - f*ry, vz - f*rz
Spring.SetProjectileVelocity(proID, nx, ny, nz)
return true
end
return false
--]]

local weaponDefID = Spring.GetProjectileDefID(proID)
if passedProjectile[proID] then
return true
--elseif select(2, Spring.GetProjectilePosition(proID)) < 0 then
-- passedProjectile[proID] = true
-- return true
elseif weaponDefID and shieldCarrierUnitID and shieldEmitterWeaponNum and noExplode[weaponDefID] then
local _, charge = Spring.GetUnitShieldState(shieldCarrierUnitID) --FIXME figure out a way to get correct shield
if charge and shieldDamages[weaponDefID] < charge then
Spring.DeleteProjectile(proID)
else
passedProjectile[proID] = true
end
end

return false

end

function gadget:ProjectileDestroyed(proID)
if passedProjectile[proID] then
passedProjectile[proID] = false
end
end


function gadget:Initialize()
for id, _ in pairs(noExplode) do
Script.SetWatchProjectile(id, true)
end
end
2 changes: 1 addition & 1 deletion LuaRules/Gadgets/weapon_single_hit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end
function gadget:GetInfo()
return {
name = "Single-Hit Weapon",
desc = "Forces marked weapons to only inflict damage once per projectile per unit",
desc = "Forces marked weapons to only inflict damage once per projectile per unit. For use with noexplode weapons.",
author = "Anarchid",
date = "25.03.2013",
license = "Public domain",
Expand Down
4 changes: 4 additions & 0 deletions LuaUI/Widgets_Evo/camera_shake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function widget:ShockFront(power, dx, dy, dz)
power = 10
end
shake = shake + power
if shake > 0.05 then
shake = 0.05
end
--Spring.Echo ("Shake Power is " .. shake)
end


Expand Down
8 changes: 4 additions & 4 deletions LuaUI/Widgets_Evo/unit_automaticFightCommand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ local function SetupUnit(unitID)
local x, y, z = spGetUnitPosition(unitID)
if x and y and z then
if (x > hmsx) then -- avoid to issue commands outside map
x = x - 50
x = x - 1
else
x = x + 50
x = x + 1
end
if (z > hmsz) then
z = z - 50
z = z - 1
else
z = z + 50
z = z + 1
end
-- meta enables reclaim enemy units, alt autoresurrect ( if available )
spGiveOrderToUnit(unitID, CMD_FIGHT, { x, y, z }, {"meta"})
Expand Down
Binary file modified Objects3D/Lootboxes/lootbox.s3o
Binary file not shown.
Binary file added Objects3D/Lootboxes/lootbox3x3.s3o
Binary file not shown.
Binary file added Objects3D/Lootboxes/lootbox4x4.s3o
Binary file not shown.
Binary file added Objects3D/Lootboxes/lootbox5x5.s3o
Binary file not shown.
Binary file added Objects3D/Lootboxes/lootbox6x6.s3o
Binary file not shown.
Binary file added Objects3D/ebox_small.s3o
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ unitDef = {
bankscale = "1",
brakeRate = 0.7,
buildCostEnergy = 0,
buildCostMetal = 20,
buildCostMetal = 10,
buildTime = 2.5,
buildpic = "edrone.png",
canAttack = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ weaponDefs = {
},
},

riottankshotgun = {
AreaOfEffect = 75,
riottankshotgun = 75,
avoidFriendly = false,
avoidFeature = false,
collideFriendly = false,
Expand All @@ -172,16 +171,17 @@ weaponDefs = {

cegTag = "bruisercannon",
edgeeffectiveness = 1,
explosionGenerator = "custom:genericshellexplosion-small",
explosionGenerator = "custom:genericshellexplosion-large-sparks-burn",
energypershot = 0,
interceptedByShieldType = 4,
impulseFactor = 0,
name = "Shotgun",
noSelfDamage = true,
noexplode = true,
projectiles = 5,
range = 500,
reloadtime = 1.5,
sprayangle = 2000,
reloadtime = 5,
sprayangle = 3500,
size = 2,
weaponType = "Cannon",
soundHit = "explosions/mediumcannonhit.wav",
Expand All @@ -193,9 +193,10 @@ weaponDefs = {
isupgraded = isUpgraded,
damagetype = "light",
nofriendlyfire = true,
single_hit = true,
},
damage = {
default = 30,
default = 150,
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,17 @@ weaponDefs = {

cegTag = "bruisercannon",
edgeeffectiveness = 1,
explosionGenerator = "custom:genericshellexplosion-small",
explosionGenerator = "custom:genericshellexplosion-large-sparks-burn",
energypershot = 0,
interceptedByShieldType = 4,
impulseFactor = 0,
name = "Shotgun",
noSelfDamage = true,
noexplode = true,
projectiles = 5,
range = 500,
reloadtime = 1.5,
sprayangle = 2000,
reloadtime = 5,
sprayangle = 3500,
size = 2,
weaponType = "Cannon",
soundHit = "explosions/mediumcannonhit.wav",
Expand All @@ -181,9 +182,10 @@ weaponDefs = {
isupgraded = isUpgraded,
damagetype = "light",
nofriendlyfire = true,
single_hit = true,
},
damage = {
default = 30,
default = 150,
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,17 @@ weaponDefs = {

cegTag = "bruisercannon",
edgeeffectiveness = 1,
explosionGenerator = "custom:genericshellexplosion-small",
explosionGenerator = "custom:genericshellexplosion-large-sparks-burn",
energypershot = 0,
interceptedByShieldType = 4,
impulseFactor = 0,
name = "Shotgun",
noSelfDamage = true,
noexplode = true,
projectiles = 5,
range = 500,
reloadtime = 1.5,
sprayangle = 2000,
reloadtime = 5,
sprayangle = 3500,
size = 2,
weaponType = "Cannon",
soundHit = "explosions/mediumcannonhit.wav",
Expand All @@ -183,9 +184,10 @@ weaponDefs = {
isupgraded = isUpgraded,
damagetype = "light",
nofriendlyfire = true,
single_hit = true,
},
damage = {
default = 30,
default = 150,
},
},

Expand Down
2 changes: 1 addition & 1 deletion Units-Configs-Basedefs/basedefs/zaal/ztiberium_basedef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ unitDef = {
activateWhenBuilt = true,
buildAngle = 8196,
buildCostEnergy = 0,
buildCostMetal = 25,
buildCostMetal = 15,
builder = false,
buildTime = 5,
canAttack = false,
Expand Down
11 changes: 5 additions & 6 deletions Units/ebox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local unitDef = {
acceleration = 1,
brakeRate = 1,
buildCostEnergy = 0,
buildCostMetal = 35,
buildCostMetal = 15,
buildDistance = 400,
builder = false,
buildTime = 5,
Expand All @@ -36,8 +36,8 @@ local unitDef = {
energyStorage = 0,
energyUse = 0,
explodeAs = "largeExplosionGenericWhite",
footprintX = 6,
footprintZ = 6,
footprintX = 3,
footprintZ = 3,
iconType = "box",
idleAutoHeal = .5,
idleTime = 2200,
Expand All @@ -51,14 +51,13 @@ local unitDef = {
movementClass = "HOVERTANK6",
name = "B.O.X.",
noChaseCategory = "VTOL",
objectName = "ebox.s3o",
objectName = "ebox_small.s3o",
script = "ebox_lus.lua",
radarDistance = 1250,
radarEmitHeight = 300,
repairable = false,
selfDestructAs = "largeExplosionGenericWhite",
side = "CORE",
sightDistance = 250,
sightDistance = 750,
smoothAnim = true,
stealth = true,
seismicSignature = 2,
Expand Down
6 changes: 3 additions & 3 deletions Units/ebuilding/estorage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ local unitName = "estorage"
--------------------------------------------------------------------------------

local armortype = [[building]]
local storage = 25
local supplygranted = 10
local storage = 50
local supplygranted = 25

local buildCostMetal = 25
local buildCostMetal = 15
local maxDamage = buildCostMetal * 12.5

local unitDef = {
Expand Down
Loading

0 comments on commit c1ba8d7

Please sign in to comment.