From dc67525d2dd7d7d958d0c2b6a4e7454d584a984a Mon Sep 17 00:00:00 2001 From: Bruno Date: Wed, 16 Jan 2019 11:36:45 -0200 Subject: [PATCH] Bug fixes, what you expected Fixed babies growing and not being added to the town workforce. Removed the ability to attack animals for now, to avoid they chasing them through the whole map Fixed a trait error. Fixed firefly essense not being stocked with other potions. Fixed summoned critters being stuck watching the firepit/hearths Fixed crashing when importing hearthlings at re-embark Added healing tonic to shaman craftings Boosted shaman xp gain --- components/lay_egg_spot/lay_egg_spot.lua | 44 ++++++++++++++----- .../monster_spawner_component.lua | 10 ++--- data/firefly_clan_population.json | 6 ++- data/traits/traits_index.json | 2 +- entities/goblins/baby/baby.json | 2 +- .../firefly_essense/firefly_essense.json | 2 +- entities/summons/critters/beetle.json | 2 - entities/summons/critters/bitsy_ant.json | 2 - entities/summons/critters/doodles.json | 2 - entities/summons/critters/frog.json | 2 - entities/summons/critters/poyo.json | 2 - entities/summons/critters/rabbit.json | 2 - entities/summons/critters/racoon.json | 2 - entities/summons/critters/red_fox_wolf.json | 2 - entities/summons/critters/squirrel.json | 2 - entities/summons/dragon_aura/dragon_aura.json | 2 - .../summons/goblin_spirit/goblin_spirit.json | 2 - .../ui/game/start_menu/start_menu.less | 3 +- jobs/go_away_shepherd.json | 4 ++ jobs/go_away_worker.json | 4 ++ ...{index_to_merge.json => goblin_index.json} | 11 +++++ jobs/index.json | 4 -- jobs/shaman/recipes/recipes.json | 3 ++ jobs/shaman/shaman_description.json | 14 +++--- jobs/warrior/warrior_description.json | 2 +- manifest.json | 4 +- 26 files changed, 80 insertions(+), 57 deletions(-) create mode 100644 jobs/go_away_shepherd.json create mode 100644 jobs/go_away_worker.json rename jobs/{index_to_merge.json => goblin_index.json} (66%) diff --git a/components/lay_egg_spot/lay_egg_spot.lua b/components/lay_egg_spot/lay_egg_spot.lua index ebd76e5..d8f9c28 100644 --- a/components/lay_egg_spot/lay_egg_spot.lua +++ b/components/lay_egg_spot/lay_egg_spot.lua @@ -2,16 +2,36 @@ local LayEgg_spot = class() local Point3 = _radiant.csg.Point3 function LayEgg_spot:initialize() - self._sv.use_state = "off" --off, waiting, has_egg + self._sv._use_state = "off" --off, waiting, has_egg + self._sv._current_egg = nil + self._sv._current_baby = nil end function LayEgg_spot:post_activate() - if self._sv.use_state == "off" then + if self._sv._use_state == "off" then self:enable_commands(true) else --waiting or has_egg self:enable_commands(false) end self.player_id = self._entity:get_player_id() + + if self._sv._current_egg then + self._egg_listener = radiant.events.listen_once(self._sv._current_egg, 'stonehearth:on_evolved', function(e) + self:egg_hatched(e.evolved_form) + self._sv._current_egg = nil + self._egg_listener = nil + end) + end + if self._sv._current_baby then + self._baby_listener = radiant.events.listen_once(self._sv._current_baby, 'stonehearth:on_evolved', function(e) + local pop = stonehearth.population:get_population(self.player_id) + pop:create_new_goblin_citizen_from_role_data(e.evolved_form) + local job_component = e.evolved_form:add_component('stonehearth:job') + job_component:promote_to("swamp_goblins:jobs:worker", { skip_visual_effects = true }) + self._sv._current_baby = nil + self._baby_listener = nil + end) + end end function LayEgg_spot:enable_commands(enable) @@ -23,23 +43,25 @@ end function LayEgg_spot:now_waiting() self:enable_commands(false) - self._sv.use_state = "waiting" + self._sv._use_state = "waiting" --someone lay an egg stonehearth.ai:reconsider_entity(self._entity) end function LayEgg_spot:create_egg() self:enable_commands(false) - self._sv.use_state = "has_egg" + self._sv._use_state = "has_egg" local egg = radiant.entities.create_entity("swamp_goblins:goblins:egg", {owner = self.player_id}) local location = radiant.entities.get_world_grid_location(self._entity) radiant.terrain.place_entity_at_exact_location(egg, location +Point3.unit_y) radiant.effects.run_effect(egg, "stonehearth:effects:buff_tonic_energy_added") radiant.effects.run_effect(egg, "stonehearth:effects:fursplosion_effect") - self._sv.egg_listener = radiant.events.listen_once(egg, 'stonehearth:on_evolved', function(e) + self._sv._current_egg = egg + self._egg_listener = radiant.events.listen_once(egg, 'stonehearth:on_evolved', function(e) self:egg_hatched(e.evolved_form) - self._sv.egg_listener = nil + self._sv._current_egg = nil + self._egg_listener = nil end) stonehearth.ai:reconsider_entity(self._entity) @@ -47,22 +69,24 @@ end function LayEgg_spot:egg_hatched(baby) self:enable_commands(true) - self._sv.use_state = "off" + self._sv._use_state = "off" radiant.effects.run_effect(baby, "stonehearth:effects:buff_tonic_energy_added") - self._sv.baby_listener = radiant.events.listen_once(baby, 'stonehearth:on_evolved', function(e) + self._sv._current_baby = baby + self._baby_listener = radiant.events.listen_once(baby, 'stonehearth:on_evolved', function(e) local pop = stonehearth.population:get_population(self.player_id) pop:create_new_goblin_citizen_from_role_data(e.evolved_form) local job_component = e.evolved_form:add_component('stonehearth:job') job_component:promote_to("swamp_goblins:jobs:worker", { skip_visual_effects = true }) - self._sv.baby_listener = nil + self._sv._current_baby = nil + self._baby_listener = nil end) stonehearth.ai:reconsider_entity(self._entity) end function LayEgg_spot:current_stage() - return self._sv.use_state + return self._sv._use_state end return LayEgg_spot \ No newline at end of file diff --git a/components/monster_spawner/monster_spawner_component.lua b/components/monster_spawner/monster_spawner_component.lua index f93e0e3..7f754dd 100644 --- a/components/monster_spawner/monster_spawner_component.lua +++ b/components/monster_spawner/monster_spawner_component.lua @@ -18,9 +18,9 @@ end function SwampGoblins_Monster_Spawner:activate_the_spawner() local delayed_function = function () - if not self._sv.spawn_timer then + if not self._sv._spawn_timer then self:try_to_spawn_monster() - self._sv.spawn_timer = stonehearth.calendar:set_persistent_interval("SwampGoblins_Monster_Spawner spawn_timer", self.interval, radiant.bind(self, 'try_to_spawn_monster'), self.interval) + self._sv._spawn_timer = stonehearth.calendar:set_persistent_interval("SwampGoblins_Monster_Spawner spawn_timer", self.interval, radiant.bind(self, 'try_to_spawn_monster'), self.interval) self.__saved_variables:mark_changed() end self.stupid_delay:destroy() @@ -48,9 +48,9 @@ function SwampGoblins_Monster_Spawner:spawn_monster(location) end function SwampGoblins_Monster_Spawner:destroy_spawn_timer() - if self._sv.spawn_timer then - self._sv.spawn_timer:destroy() - self._sv.spawn_timer = nil + if self._sv._spawn_timer then + self._sv._spawn_timer:destroy() + self._sv._spawn_timer = nil self.__saved_variables:mark_changed() end end diff --git a/data/firefly_clan_population.json b/data/firefly_clan_population.json index c4680e8..a332ff4 100644 --- a/data/firefly_clan_population.json +++ b/data/firefly_clan_population.json @@ -19,7 +19,11 @@ "trappable_animals": "swamp_goblins:data:trapping:all_trappable_animals", "default_material": "fiber resource", "amenity_to": { - "animals": "hostile" + "goblins": "neutral", + "orcs": "neutral", + "human_npcs": "neutral", + "orc_npcs": "neutral", + "rabbit_biped_npcs": "neutral" }, "ordinal": 3.01, "roles": { diff --git a/data/traits/traits_index.json b/data/traits/traits_index.json index 4be1e05..645f863 100644 --- a/data/traits/traits_index.json +++ b/data/traits/traits_index.json @@ -27,7 +27,6 @@ "swamp_goblins:traits:passion_shaman":{}, "swamp_goblins:traits:passion_spirit_walker":{}, "swamp_goblins:traits:passion_warrior":{}, - "swamp_goblins:traits:party_goblin": {}, "stonehearth:traits:passion_worker":{} }, "build": { @@ -40,6 +39,7 @@ } }, "traits": { + "swamp_goblins:traits:party_goblin": {}, "stonehearth:traits:courageous": {}, "stonehearth:traits:callous": { "excludes": { diff --git a/entities/goblins/baby/baby.json b/entities/goblins/baby/baby.json index 105bb59..331dfd5 100644 --- a/entities/goblins/baby/baby.json +++ b/entities/goblins/baby/baby.json @@ -39,7 +39,7 @@ "stonehearth:evolve_data": { "current_stage": "baby", "next_stage": "swamp_goblins:goblins:goblin", - "evolve_time": "1d+1h", + "evolve_time": "1d", "evolve_effect": "stonehearth:effects:fursplosion_effect" }, "stonehearth:catalog": { diff --git a/entities/resources/firefly_essense/firefly_essense.json b/entities/resources/firefly_essense/firefly_essense.json index 1f53297..77674ca 100644 --- a/entities/resources/firefly_essense/firefly_essense.json +++ b/entities/resources/firefly_essense/firefly_essense.json @@ -33,7 +33,7 @@ "icon": "file(firefly_essense.png)", "is_item": true, "category": "resources", - "material_tags":["firefly", "resource", "stockpile_animal_part"] + "material_tags":["firefly", "resource", "stockpile_animal_part", "consumable", "stockpile_consumable"] } } } \ No newline at end of file diff --git a/entities/summons/critters/beetle.json b/entities/summons/critters/beetle.json index 51869bc..9e72403 100644 --- a/entities/summons/critters/beetle.json +++ b/entities/summons/critters/beetle.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/bitsy_ant.json b/entities/summons/critters/bitsy_ant.json index 0d909a9..1ffafb8 100644 --- a/entities/summons/critters/bitsy_ant.json +++ b/entities/summons/critters/bitsy_ant.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/doodles.json b/entities/summons/critters/doodles.json index 5fea8ef..1e5f5b9 100644 --- a/entities/summons/critters/doodles.json +++ b/entities/summons/critters/doodles.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/frog.json b/entities/summons/critters/frog.json index 16b7e40..593f77a 100644 --- a/entities/summons/critters/frog.json +++ b/entities/summons/critters/frog.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/poyo.json b/entities/summons/critters/poyo.json index dd0eba9..7c5a3d1 100644 --- a/entities/summons/critters/poyo.json +++ b/entities/summons/critters/poyo.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/rabbit.json b/entities/summons/critters/rabbit.json index b215d7b..03fb5cd 100644 --- a/entities/summons/critters/rabbit.json +++ b/entities/summons/critters/rabbit.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/racoon.json b/entities/summons/critters/racoon.json index 651915c..954ff15 100644 --- a/entities/summons/critters/racoon.json +++ b/entities/summons/critters/racoon.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/red_fox_wolf.json b/entities/summons/critters/red_fox_wolf.json index 38efce4..01a417d 100644 --- a/entities/summons/critters/red_fox_wolf.json +++ b/entities/summons/critters/red_fox_wolf.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/critters/squirrel.json b/entities/summons/critters/squirrel.json index 4f638eb..a94d0cc 100644 --- a/entities/summons/critters/squirrel.json +++ b/entities/summons/critters/squirrel.json @@ -117,8 +117,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/dragon_aura/dragon_aura.json b/entities/summons/dragon_aura/dragon_aura.json index eb7f329..056482a 100644 --- a/entities/summons/dragon_aura/dragon_aura.json +++ b/entities/summons/dragon_aura/dragon_aura.json @@ -133,8 +133,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/entities/summons/goblin_spirit/goblin_spirit.json b/entities/summons/goblin_spirit/goblin_spirit.json index af35425..e2fb8bc 100644 --- a/entities/summons/goblin_spirit/goblin_spirit.json +++ b/entities/summons/goblin_spirit/goblin_spirit.json @@ -149,8 +149,6 @@ "stonehearth:ai_pack:combat_control", "stonehearth:ai_pack:human", "stonehearth:ai_pack:combat", - "stonehearth:ai_pack:free_time", - "stonehearth:ai_pack:citizen_rescue", "stonehearth:ai_pack:conversation", "stonehearth:ai_pack:idle", "stonehearth:ai_pack:idle:bored:idle_effects", diff --git a/firefly_clan_selected/ui/game/start_menu/start_menu.less b/firefly_clan_selected/ui/game/start_menu/start_menu.less index 85f2653..abfbd2c 100644 --- a/firefly_clan_selected/ui/game/start_menu/start_menu.less +++ b/firefly_clan_selected/ui/game/start_menu/start_menu.less @@ -7,5 +7,4 @@ div[parent~="crafter_menu"] div.button:not(.swamp_goblins_button){ div[parent~="crafter_menu"] div#fisher, div[parent~="crafter_menu"] div#trapper{ display: inline-block; -} -/*[parent~="zone_menu"]*/ \ No newline at end of file +} \ No newline at end of file diff --git a/jobs/go_away_shepherd.json b/jobs/go_away_shepherd.json new file mode 100644 index 0000000..34436d0 --- /dev/null +++ b/jobs/go_away_shepherd.json @@ -0,0 +1,4 @@ +{ + "mixins": "stonehearth:jobs:shepherd", + "enabled": false +} \ No newline at end of file diff --git a/jobs/go_away_worker.json b/jobs/go_away_worker.json new file mode 100644 index 0000000..2fa2d4c --- /dev/null +++ b/jobs/go_away_worker.json @@ -0,0 +1,4 @@ +{ + "mixins": "stonehearth:jobs:worker", + "enabled": false +} \ No newline at end of file diff --git a/jobs/index_to_merge.json b/jobs/goblin_index.json similarity index 66% rename from jobs/index_to_merge.json rename to jobs/goblin_index.json index a567fb0..2c29700 100644 --- a/jobs/index_to_merge.json +++ b/jobs/goblin_index.json @@ -1,5 +1,13 @@ { + "mixins": "stonehearth:jobs:index", + "base_job":"swamp_goblins:jobs:worker", "jobs": { + "stonehearth:jobs:worker": { + "description": "file(go_away_worker.json)" + }, + "stonehearth:jobs:shepherd": { + "description": "file(go_away_shepherd.json)" + }, "swamp_goblins:jobs:worker": { "description": "swamp_goblins:jobs:worker" }, @@ -12,6 +20,9 @@ "swamp_goblins:jobs:earthmaster": { "description": "swamp_goblins:jobs:earthmaster" }, + "stonehearth:jobs:trapper": { + "description": "swamp_goblins:jobs:scavenger" + }, "swamp_goblins:jobs:shaman": { "description": "swamp_goblins:jobs:shaman" }, diff --git a/jobs/index.json b/jobs/index.json index 659790f..a567fb0 100644 --- a/jobs/index.json +++ b/jobs/index.json @@ -1,5 +1,4 @@ { - "base_job":"swamp_goblins:jobs:worker", "jobs": { "swamp_goblins:jobs:worker": { "description": "swamp_goblins:jobs:worker" @@ -13,9 +12,6 @@ "swamp_goblins:jobs:earthmaster": { "description": "swamp_goblins:jobs:earthmaster" }, - "stonehearth:jobs:trapper": { - "description": "swamp_goblins:jobs:scavenger" - }, "swamp_goblins:jobs:shaman": { "description": "swamp_goblins:jobs:shaman" }, diff --git a/jobs/shaman/recipes/recipes.json b/jobs/shaman/recipes/recipes.json index 02368b1..2d39ee0 100644 --- a/jobs/shaman/recipes/recipes.json +++ b/jobs/shaman/recipes/recipes.json @@ -51,6 +51,9 @@ "recipes": { "firefly_essense": { "recipe": "file(firefly_essense_recipe.json)" + }, + "small_herbal_tonic": { + "recipe": "stonehearth/jobs/herbalist/recipes/small_healing_tonic_recipe.json" } } }, diff --git a/jobs/shaman/shaman_description.json b/jobs/shaman/shaman_description.json index a473199..f9d01fe 100644 --- a/jobs/shaman/shaman_description.json +++ b/jobs/shaman/shaman_description.json @@ -43,13 +43,13 @@ }, "parent_job": "swamp_goblins:jobs:worker", "xp_rewards": { - "craft_level_0": 15, - "craft_level_1": 17, - "craft_level_2": 19, - "craft_level_3": 21, - "craft_level_4": 23, - "craft_level_5": 25, - "craft_level_6": 27 + "craft_level_0": 30, + "craft_level_1": 32, + "craft_level_2": 34, + "craft_level_3": 36, + "craft_level_4": 38, + "craft_level_5": 40, + "craft_level_6": 42 }, "max_level": 6, "level_data": { diff --git a/jobs/warrior/warrior_description.json b/jobs/warrior/warrior_description.json index 746eb88..28604ce 100644 --- a/jobs/warrior/warrior_description.json +++ b/jobs/warrior/warrior_description.json @@ -25,7 +25,7 @@ ], "parent_job": "swamp_goblins:jobs:worker", "xp_rewards": { - "town_protection": 1 + "town_protection": 2 }, "max_level": 6, "level_data": { diff --git a/manifest.json b/manifest.json index 3c6473c..305b54e 100644 --- a/manifest.json +++ b/manifest.json @@ -147,7 +147,7 @@ "goblins:goblin": "file(entities/goblins/goblin.json)", "goblins:goblin:customizations":"file(entities/goblins/customizations.json)", - "jobs:index": "file(jobs/index.json)", + "jobs:index": "file(jobs/goblin_index.json)", "jobs:beast_tamer": "file(jobs/beast_tamer/beast_tamer_description.json)", "jobs:bonesmith": "file(jobs/bonesmith/bonesmith_description.json)", "jobs:earthmaster": "file(jobs/earthmaster/earthmaster_description.json)", @@ -309,7 +309,7 @@ "stonehearth:kingdoms:forest": "file(services/server/population/data/forest_population.json)", - "stonehearth:jobs:index": "file(jobs/index_to_merge.json)", + "stonehearth:jobs:index": "file(jobs/index.json)", "stonehearth/jobs/carpenter/recipes/recipes.json": "file(jobs/carpenter/recipes)", "stonehearth/locales/en.json":"file(locales/mixintos_en.json)",