Skip to content

Commit

Permalink
Bug fixes, what you expected
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BrunoSupremo committed Jan 16, 2019
1 parent 927dbe6 commit dc67525
Show file tree
Hide file tree
Showing 26 changed files with 80 additions and 57 deletions.
44 changes: 34 additions & 10 deletions components/lay_egg_spot/lay_egg_spot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -23,46 +43,50 @@ 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)
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
10 changes: 5 additions & 5 deletions components/monster_spawner/monster_spawner_component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion data/firefly_clan_population.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion data/traits/traits_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -40,6 +39,7 @@
}
},
"traits": {
"swamp_goblins:traits:party_goblin": {},
"stonehearth:traits:courageous": {},
"stonehearth:traits:callous": {
"excludes": {
Expand Down
2 changes: 1 addition & 1 deletion entities/goblins/baby/baby.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion entities/resources/firefly_essense/firefly_essense.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}
2 changes: 0 additions & 2 deletions entities/summons/critters/beetle.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/bitsy_ant.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/doodles.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/frog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/poyo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/rabbit.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/racoon.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/red_fox_wolf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/critters/squirrel.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/dragon_aura/dragon_aura.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions entities/summons/goblin_spirit/goblin_spirit.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions firefly_clan_selected/ui/game/start_menu/start_menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -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"]*/
}
4 changes: 4 additions & 0 deletions jobs/go_away_shepherd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mixins": "stonehearth:jobs:shepherd",
"enabled": false
}
4 changes: 4 additions & 0 deletions jobs/go_away_worker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mixins": "stonehearth:jobs:worker",
"enabled": false
}
11 changes: 11 additions & 0 deletions jobs/index_to_merge.json → jobs/goblin_index.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand All @@ -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"
},
Expand Down
4 changes: 0 additions & 4 deletions jobs/index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"base_job":"swamp_goblins:jobs:worker",
"jobs": {
"swamp_goblins:jobs:worker": {
"description": "swamp_goblins:jobs:worker"
Expand All @@ -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"
},
Expand Down
3 changes: 3 additions & 0 deletions jobs/shaman/recipes/recipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
14 changes: 7 additions & 7 deletions jobs/shaman/shaman_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion jobs/warrior/warrior_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"parent_job": "swamp_goblins:jobs:worker",
"xp_rewards": {
"town_protection": 1
"town_protection": 2
},
"max_level": 6,
"level_data": {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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)",
Expand Down

0 comments on commit dc67525

Please sign in to comment.