Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

Commit

Permalink
Merge branch 'development' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWilko committed Mar 31, 2015
2 parents ad8379b + 5dcddcd commit ae70006
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions GoonMod/goonbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ GoonBase.HookFiles = {
["lib/network/networkgame"] = "NetworkGame.lua",
["lib/tweak_data/upgradestweakdata"] = "UpgradesTweakData.lua",
["lib/network/base/networkmanager"] = "NetworkManager.lua",
["lib/units/weapons/sentrygunweapon"] = "SentryGunWeapon.lua"

}

Expand Down
14 changes: 14 additions & 0 deletions GoonMod/lua/SentryGunWeapon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

CloneClass( SentryGunWeapon )

Hooks:RegisterHook("SentryGunWeaponOnPostSetup")
function SentryGunWeapon.setup( self, setup_data, damage_multiplier )
self.orig.setup( self, setup_data, damage_multiplier )
Hooks:Call( "SentryGunWeaponOnPostSetup", self, setup_data, damage_multiplier )
end

Hooks:RegisterHook("SentryGunWeaponOnApplyDamageMultiplier")
function SentryGunWeapon._apply_dmg_mul( self, damage, col_ray, from_pos )
local val = Hooks:ReturnCall("SentryGunWeaponOnApplyDamageMultiplier", self, damage, col_ray, from_pos)
return val or self.orig._apply_dmg_mul( self, damage, col_ray, from_pos )
end
3 changes: 2 additions & 1 deletion GoonMod/mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
{ "hook_id" : "lib/managers/menu/skilltreegui", "script_path" : "goonbase.lua" },
{ "hook_id" : "lib/network/networkgame", "script_path" : "goonbase.lua" },
{ "hook_id" : "lib/tweak_data/upgradestweakdata", "script_path" : "goonbase.lua" },
{ "hook_id" : "lib/network/base/networkmanager", "script_path" : "goonbase.lua" }
{ "hook_id" : "lib/network/base/networkmanager", "script_path" : "goonbase.lua" },
{ "hook_id" : "lib/units/weapons/sentrygunweapon", "script_path" : "goonbase.lua" }
]
}
12 changes: 12 additions & 0 deletions GoonMod/mutators/mutator_instagib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ BaseMutator.IsAllowedInRandomizer = false
Mutator._RWChkID = "NewRaycastWeaponBase_" .. Mutator.Id
Mutator._RWChkIDPost = "NewRaycastWeaponBase_PostHook_" .. Mutator.Id
Mutator._NPChkID = "NPCRaycastWeaponBase_" .. Mutator.Id
Mutator._SGChkID = "SentryGunWeaponOnPostSetup_" .. Mutator.Id
Mutator._SGWepChkID = "SentryGunWeaponOnApplyDamageMultiplier_" .. Mutator.Id

Hooks:Add("GoonBaseRegisterMutators", "GoonBaseRegisterMutators_" .. Mutator.Id, function()
GoonBase.Mutators:RegisterMutator( Mutator )
Expand All @@ -28,12 +30,22 @@ function Mutator:OnEnabled()
weapon._damage = math.huge
end)

Hooks:Add("SentryGunWeaponOnPostSetup", self._SGChkID, function(sentry, setup_data, damage_multiplier)
sentry._damage = math.huge
end)

Hooks:Add("SentryGunWeaponOnApplyDamageMultiplier", self._SGWepChkID, function(sentry, damage, col_ray, from_pos)
return math.huge
end)

end

function Mutator:OnDisabled()

Hooks:Remove(self._RWChkID)
Hooks:RemovePostHook(self._RWChkIDPost)
Hooks:Remove(self._NPChkID)
Hooks:Remove(self._SGChkID)
Hooks:Remove(self._SGWepChkID)

end
2 changes: 1 addition & 1 deletion GoonMod/mutators/mutator_no_ammo_pickups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ end

function Mutator:CheckSpawnAmmoBag(unit)

if GoonBase.Network:IsMultiplayer() and GoonBase.Network:IsHost() then
if LuaNetworking:IsMultiplayer() and LuaNetworking:IsHost() then

self.DozersKilledSinceAmmo = self.DozersKilledSinceAmmo + 1
local dozers = self.DozersKilledSinceAmmo
Expand Down
2 changes: 1 addition & 1 deletion GoonMod/mutators/mutator_suicide_cloakers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Mutator:Detonate(spooc)
})
managers.explosion:play_sound_and_effects(pos, math.UP, range, explosion_params)

if GoonBase.Network:IsMultiplayer() and GoonBase.Network:IsHost() then
if LuaNetworking:IsMultiplayer() and LuaNetworking:IsHost() then

local grenade_type = "launcher_frag"
local unit_name = Idstring(tweak_data.blackmarket.grenades[grenade_type].unit)
Expand Down

0 comments on commit ae70006

Please sign in to comment.