Skip to content

Commit

Permalink
fixed error on peaceful campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoSupremo committed Sep 5, 2019
1 parent 9d77bf7 commit 0245286
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ local game_master_lib = require 'stonehearth.lib.game_master.game_master_lib'

function FireflyBossDeathScript:start(ctx)
stonehearth.player:set_neutral_to_everyone(ctx.npc_player_id, true)
if ctx.boss and ctx.boss:is_valid() then
--bleh
else
self._delay_for_nina = radiant.on_game_loop_once('delayed for nina ai', function()
local nina = radiant.entities.create_entity("swamp_goblins:humans:nina", {owner = ctx.npc_player_id})
nina:get_component('stonehearth:job'):promote_to("stonehearth:jobs:footman")
local equips = nina:add_component('stonehearth:equipment')
equips:equip_item("stonehearth:geomancer:staff")
equips:equip_item("/stonehearth/jobs/cleric/cleric_abilities/cleric_abilities.json")
radiant.terrain.place_entity(nina, ctx["firefly_human_encounter"].boss_location)
game_master_lib.register_entities(ctx, 'firefly_human_encounter', { boss = nina })
self._delay_for_nina = nil
end)
end
self._delay_for_nina = radiant.on_game_loop_once('delayed for nina ai', function()
local nina = radiant.entities.create_entity("swamp_goblins:humans:nina", {owner = ctx.npc_player_id})
nina:get_component('stonehearth:job'):promote_to("stonehearth:jobs:footman")
local equips = nina:add_component('stonehearth:equipment')
equips:equip_item("stonehearth:geomancer:staff")
equips:equip_item("/stonehearth/jobs/cleric/cleric_abilities/cleric_abilities.json")
radiant.terrain.place_entity(nina, ctx["firefly_human_encounter"].boss_location)
game_master_lib.register_entities(ctx, 'firefly_human_encounter', { boss = nina })
self._delay_for_nina = nil
end)
end

return FireflyBossDeathScript
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"min": 100,
"max": 250
},
"script": "file(boss_death_script.lua)",
"script": "file(make_them_neutral.lua)",
"boss": {
"from_population": {
"role":"nina",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local FireflyBossNeutral = class()

function FireflyBossNeutral:start(ctx)
stonehearth.player:set_neutral_to_everyone(ctx.npc_player_id, true)
self._delay_for_nina = radiant.on_game_loop_once('delayed for nina ai', function()
local nina = ctx["firefly_human_encounter"].boss
local equips = nina:add_component('stonehearth:equipment')
equips:equip_item("/stonehearth/jobs/cleric/cleric_abilities/cleric_abilities.json")
self._delay_for_nina = nil
end)
end

return FireflyBossNeutral
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:appeal": {
"appeal": 3
}
}
}
2 changes: 1 addition & 1 deletion entities/monsters/varanus_nest/varanus_nest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"mob": {
"model_origin": {"x": 0, "y": 0, "z": 0 },
"region_origin": {"x": 0, "y": 0, "z": 0 }
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 }
},
"destination": {
"region": [
Expand Down
3 changes: 3 additions & 0 deletions jobs/bonesmith/bonesmith_workbench/bonesmith_workbench.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:appeal": {
"appeal": 4
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"sellable": true,
"shopkeeper_type": "caravan"
}
},
"stonehearth:appeal": {
"appeal": 15
},
"stonehearth:item_quality": {
"variable_quality": true
}
}
}
}
3 changes: 3 additions & 0 deletions jobs/shaman/shaman_firefly_token/shaman_firefly_token.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:appeal": {
"appeal": 4
}
}
}
3 changes: 3 additions & 0 deletions jobs/shaman/shaman_workbench/shaman_workbench.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:appeal": {
"appeal": 6
}
}
}

0 comments on commit 0245286

Please sign in to comment.