-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changelog: - Fix Hood with Mouth Piece not spawning on Brigand Marksmen as intended - Change internal hook structure to create less noise in logs on initial startup
- Loading branch information
Showing
24 changed files
with
254 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 30, P = 1.0, S = "helmets/closed_conic_helmet" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("entity/world/attached_location/leather_tanner_location", function(ltl) { | ||
local onUpdateShopList = ::mods_getMember(ltl, "onUpdateShopList"); | ||
|
||
ltl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 45, P = 1.0, S = "helmets/closed_conic_helmet" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("entity/tactical/humans/mercenary", function(merc) { | ||
local assignRandomEquipment = ::mods_getMember(merc, "assignRandomEquipment"); | ||
|
||
merc.assignRandomEquipment = function() { | ||
assignRandomEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 6) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/closed_conic_helmet")); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 30, P = 1.0, S = "helmets/closed_conic_helmet_with_mail" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
10 changes: 10 additions & 0 deletions
10
script_hooks/mod_sae_closed_conic_helmet_with_neckguard.nut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 35, P = 1.0, S = "helmets/closed_conic_helmet_with_neckguard" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
::mods_hookExactClass("entity/tactical/enemies/bandit_marksman", function(bm) { | ||
local assignRandomEquipment = ::mods_getMember(bm, "assignRandomEquipment"); | ||
|
||
bm.assignRandomEquipment = function() { | ||
assignRandomEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 16) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/hood_with_mouth_piece")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("entity/tactical/enemies/bandit_marksman_low", function(bml) { | ||
local assignRandomEquipment = ::mods_getMember(bml, "assignRandomEquipment"); | ||
|
||
bml.assignRandomEquipment = function() { | ||
assignRandomEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 33) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/hood_with_mouth_piece")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("skills/backgrounds/killer_on_the_run_background", function(kotrb) { | ||
local onAddEquipment = ::mods_getMember(kotrb, "onAddEquipment"); | ||
|
||
kotrb.onAddEquipment = function() { | ||
onAddEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 50) { | ||
getContainer().getActor().getItems().unequip(getContainer().getActor().getItems().getItemAtSlot(Const.ItemSlot.Head)); | ||
getContainer().getActor().getItems().equip(new("scripts/items/helmets/hood_with_mouth_piece")); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 85, P = 1.0, S = "helmets/iron_pot_helm" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
::mods_hookExactClass("entity/tactical/humans/nomad_outlaw", function(no) { | ||
local assignRandomEquipment = ::mods_getMember(no, "assignRandomEquipment"); | ||
|
||
no.assignRandomEquipment = function() { | ||
assignRandomEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 20) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/oriental/masked_nomad_light_helmet")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("skills/backgrounds/nomad_background", function(nb) { | ||
local onAddEquipment = ::mods_getMember(nb, "onAddEquipment"); | ||
|
||
nb.onAddEquipment = function() { | ||
onAddEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 25) { | ||
getContainer().getActor().getItems().unequip(getContainer().getActor().getItems().getItemAtSlot(Const.ItemSlot.Head)); | ||
getContainer().getActor().getItems().equip(new("scripts/items/helmets/oriental/masked_nomad_light_helmet")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("skills/backgrounds/nomad_ranged_background", function(nrb) { | ||
local onAddEquipment = ::mods_getMember(nrb, "onAddEquipment"); | ||
|
||
nrb.onAddEquipment = function() { | ||
onAddEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 25) { | ||
getContainer().getActor().getItems().unequip(getContainer().getActor().getItems().getItemAtSlot(Const.ItemSlot.Head)); | ||
getContainer().getActor().getItems().equip(new("scripts/items/helmets/oriental/masked_nomad_light_helmet")); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
getroottable().Const.Items.NamedSouthernHelmets.push("helmets/named/named_nomad_light_helmet") | ||
getroottable().Const.Items.NamedHelmets.push("helmets/named/named_nomad_light_helmet") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
::mods_hookExactClass("skills/backgrounds/assassin_southern_background", function(ab) { | ||
local onAddEquipment = ::mods_getMember(ab, "onAddEquipment"); | ||
|
||
ab.onAddEquipment = function() { | ||
onAddEquipment(); | ||
|
||
if (Math.rand(1, 100) <= 33) { | ||
getContainer().getActor().getItems().unequip(getContainer().getActor().getItems().getItemAtSlot(Const.ItemSlot.Body)); | ||
getContainer().getActor().getItems().equip(new("scripts/items/armor/oriental/reinforced_padded_armor")); | ||
} | ||
} | ||
}); |
27 changes: 27 additions & 0 deletions
27
script_hooks/mod_sae_southern_conic_helmet_with_closed_mail.nut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
::mods_hookExactClass("entity/tactical/humans/officer", function(o) { | ||
local assignRandomEquipment = ::mods_getMember(o, "assignRandomEquipment"); | ||
|
||
o.assignRandomEquipment = function() { | ||
local hasFamedHelmet = m.Items.getItemAtSlot(Const.ItemSlot.Head) != null; | ||
|
||
assignRandomEquipment(); | ||
|
||
if (!hasFamedHelmet && Math.rand(1, 100) <= 25) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/oriental/southern_conic_helmet_with_closed_mail")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookBaseClass("entity/world/settlement", function(s) { | ||
while(!("onUpdateShopList" in s)) s = s[s.SuperName]; | ||
|
||
local onUpdateShopList = s.onUpdateShopList; | ||
|
||
s.onUpdateShopList = function( _id, _list ) { | ||
if (Const.DLC.Desert && _id == "building.armorsmith_oriental") | ||
_list.push({ R = 35, P = 1.0, S = "helmets/oriental/southern_conic_helmet_with_closed_mail" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 65, P = 1.0, S = "helmets/visored_barbute_helmet" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); | ||
|
||
::mods_hookBaseClass("entity/world/settlement", function(s) { | ||
while(!("onUpdateShopList" in s)) s = s[s.SuperName]; | ||
|
||
local onUpdateShopList = s.onUpdateShopList; | ||
|
||
s.onUpdateShopList = function( _id, _list ) { | ||
if (Const.DLC.Unhold && _id == "building.armorsmith") | ||
_list.push({ R = 85, P = 1.0, S = "helmets/visored_barbute_helmet" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
::mods_hookExactClass("entity/tactical/humans/hedge_knight", function(hk) { | ||
local assignRandomEquipment = ::mods_getMember(hk, "assignRandomEquipment"); | ||
|
||
hk.assignRandomEquipment = function() { | ||
local hasFamedHelmet = m.Items.getItemAtSlot(Const.ItemSlot.Head) != null; | ||
|
||
assignRandomEquipment(); | ||
|
||
if (!hasFamedHelmet && Math.rand(1, 100) <= 33) { | ||
m.Items.unequip(m.Items.getItemAtSlot(Const.ItemSlot.Head)); | ||
m.Items.equip(new("scripts/items/helmets/visored_plumed_bascinet_helmet")); | ||
} | ||
} | ||
}); | ||
|
||
::mods_hookExactClass("entity/world/attached_location/blast_furnace_location", function(bfl) { | ||
local onUpdateShopList = ::mods_getMember(bfl, "onUpdateShopList"); | ||
|
||
bfl.onUpdateShopList = function( _id, _list ) { | ||
if (_id == "building.armorsmith") | ||
_list.push({ R = 45, P = 1.0, S = "helmets/visored_plumed_bascinet_helmet" }); | ||
|
||
onUpdateShopList( _id, _list ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
::mods_registerMod("sato_additional_equipment", 3.2, "Sato's Additional Equipment"); | ||
::mods_registerMod("sato_additional_equipment", 3.3, "Sato's Additional Equipment"); | ||
|
||
::mods_queue("sato_additional_equipment", null, function() { | ||
::include("script_hooks/mod_sae_closed_conic_helmet_with_mail"); | ||
::include("script_hooks/mod_sae_closed_conic_helmet_with_neckguard"); | ||
::include("script_hooks/mod_sae_closed_conic_helmet"); | ||
::include("script_hooks/mod_sae_hood_with_mouth_piece"); | ||
::include("script_hooks/mod_sae_iron_pot_helm"); | ||
::include("script_hooks/mod_sae_masked_nomad_light_helmet"); | ||
::include("script_hooks/mod_sae_named_nomad_light_helmet"); | ||
::include("script_hooks/mod_sae_reinforced_padded_armor"); | ||
::include("script_hooks/mod_sae_southern_conic_helmet_with_closed_mail"); | ||
::include("script_hooks/mod_sae_visored_barbute_helmet"); | ||
::include("script_hooks/mod_sae_visored_plumed_bascinet_helmet"); | ||
}); |
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
scripts/!mods_preload/mod_sae_closed_conic_helmet_with_mail.nut
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
scripts/!mods_preload/mod_sae_closed_conic_helmet_with_neckguard.nut
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.