Skip to content

Commit

Permalink
Fixed Multiplayer Bugs
Browse files Browse the repository at this point in the history
Added small tip explaing how to get more goblins
Added flower seeds
  • Loading branch information
BrunoSupremo committed Jan 19, 2019
1 parent 37b5e73 commit 9e55342
Show file tree
Hide file tree
Showing 21 changed files with 193 additions and 120 deletions.
19 changes: 19 additions & 0 deletions components/hacks/firefly_worker.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local FireflyWorker = class()

function FireflyWorker:post_activate()
self._job_changed_listener = radiant.events.listen(self._entity, 'stonehearth:job_changed', self, self._on_job_changed)
end

function FireflyWorker:_on_job_changed()
if self._job_changed_listener then
self._job_changed_listener:destroy()
self._job_changed_listener = nil
end
local job = self._entity:get_component('stonehearth:job'):get_job_uri()
if job == "stonehearth:jobs:worker" then
self._entity:get_component('stonehearth:job'):promote_to("swamp_goblins:jobs:worker", { skip_visual_effects = true })
end
self._entity:remove_component('swamp_goblins:firefly_worker')
end

return FireflyWorker
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "encounter",
"encounter_type": "dialog_tree",
"rarity": "common",
"in_edge": "explain_egg",
"dialog_tree_info": {
"start_node": "msg1",
"nodes": {
"msg1": {
"bulletin": {
"title": "(WIP) Daily Report",
"dialog_title": "(WIP) Daily Report",
"message": "If you are wondering how to get more goblins, check the pedestal in the shaman recipes!",
"choices": {
"ok": {
"out_edge": ""
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "encounter",
"encounter_type": "town_upgrade",
"in_edge": "upgrade_banner_1",
"out_edge": "",
"out_edge": "wait_before_egg",
"town_upgrade_info": {
"tier_achieved": 1,
"old_facility_uri": "swamp_goblins:camp_standard",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "encounter",
"encounter_type": "wait_for_time_of_day",
"in_edge" : "wait_before_egg",
"out_edge" : "explain_egg",
"wait_for_time_of_day_info": {
"time": "8:00"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"type": "arc",
"rarity": "common",
"encounters": {
"start": "file(encounters/start.json)",
"shaman_explains_his_dream": "file(encounters/shaman_explains_his_dream.json)",
"upgrade_banner": "file(encounters/upgrade_banner.json)",
"upgrade_banner_1": "file(encounters/upgrade_banner_1.json)",
"start": "file(encounters/start.json)",
"shaman_explains_his_dream":"file(encounters/shaman_explains_his_dream.json)",
"upgrade_banner": "file(encounters/upgrade_banner.json)",
"upgrade_banner_1": "file(encounters/upgrade_banner_1.json)",
"wait_before_egg": "file(encounters/wait_before_egg.json)",
"explain_egg": "file(encounters/explain_egg.json)"
}
}
1 change: 1 addition & 0 deletions entities/goblins/goblin.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"model_variant": "firefly_goblin",
"scale":0.09
},
"swamp_goblins:firefly_worker": {},
"model_variants": {
"default": {
"models": [
Expand Down
16 changes: 16 additions & 0 deletions entities/plants/giant_flower/giant_flower.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@
"weight": 1
}
}
},
"seed": {
"num_rolls": {
"min": 1,
"max": 1
},
"items": {
"none": {
"uri": "",
"weight": 4
},
"seed": {
"uri": "swamp_goblins:plants:giant_flower:seed",
"weight": 1
}
}
}
}
},
Expand Down
37 changes: 12 additions & 25 deletions entities/plants/giant_flower/seed/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,31 @@
}
},
"mob": {
"model_origin": { "x": 0, "y": 0, "z": 0 },
"model_origin": {"x": -0.1, "y": 0, "z": 0.1 },
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 }
},
"destination": {
"region": [
{
"min": {"x": 0, "y": 0, "z": 0 },
"max": {"x": 1, "y": 1, "z": 1 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
],
"adjacency_flags": [
"front_left",
"front_right",
"back_left",
"back_right"
]
},
"region_collision_shape": {
"region": [
{
"min": {"x": -1, "y": 0, "z": 0 },
"max": {"x": 0, "y": 2, "z": 1 }
},
{
"min": {"x": 1, "y": 0, "z": 0 },
"max": {"x": 2, "y": 2, "z": 1 }
},
{
"min": {"x": 0, "y": 0, "z": -1 },
"max": {"x": 1, "y": 2, "z": 2 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
]
],
"region_collision_type": "platform"
}
},
"entity_data": {
"stonehearth:evolve_data": {
"next_stage": "archipelago_biome:plants:hibiscus:sprout",
"evolve_time": "8h+4h"
"next_stage": "swamp_goblins:plants:giant_flower:sprout",
"evolve_time": "1d+4h"
},
"stonehearth:net_worth": {
"value_in_gold": 1,
Expand All @@ -77,12 +64,12 @@
}
},
"stonehearth:catalog": {
"display_name": "i18n(archipelago_biome:entities.plants.hibiscus_plant.seed.display_name)",
"description": "i18n(archipelago_biome:entities.plants.hibiscus_plant.seed.description)",
"display_name": "i18n(swamp_goblins:entities.plants.giant_flower.seed.display_name)",
"description": "i18n(swamp_goblins:entities.plants.giant_flower.seed.description)",
"icon": "file(seed.png)",
"category": "seed",
"material_tags":["stockpile_plant", "resource", "seed", "seed_hard", "plant"],
"subject_override": "archipelago_biome:plants:hibiscus"
"subject_override": "swamp_goblins:plants:giant_flower"
}
}
}
Binary file modified entities/plants/giant_flower/seed/seed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 11 additions & 24 deletions entities/plants/giant_flower/seed/seed_ghost.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,46 @@
"type": "entity",
"components": {
"render_info": {
"scale": 0.15
"scale": 0.2
},
"model_variants": {
"default": {
"models": [
{
"type": "one_of",
"items": [
"file(../hibiscus_plant.qb)"
"file(../giant_flower.qb)"
]
}
]
}
},
"mob": {
"model_origin": { "x": 0, "y": 0, "z": 0 },
"model_origin": {"x": -0.1, "y": 0, "z": 0.1 },
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 }
},
"destination": {
"region": [
{
"min": {"x": 0, "y": 0, "z": 0 },
"max": {"x": 1, "y": 1, "z": 1 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
],
"adjacency_flags": [
"front_left",
"front_right",
"back_left",
"back_right"
]
},
"region_collision_shape": {
"region": [
{
"min": {"x": -1, "y": 0, "z": 0 },
"max": {"x": 0, "y": 2, "z": 1 }
},
{
"min": {"x": 1, "y": 0, "z": 0 },
"max": {"x": 2, "y": 2, "z": 1 }
},
{
"min": {"x": 0, "y": 0, "z": -1 },
"max": {"x": 1, "y": 2, "z": 2 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
]
],
"region_collision_type": "platform"
}
},
"entity_data": {
"stonehearth:catalog": {
"display_name": "i18n(archipelago_biome:entities.plants.hibiscus_plant.seed.display_name)",
"description": "i18n(archipelago_biome:entities.plants.hibiscus_plant.seed.description)",
"display_name": "i18n(swamp_goblins:entities.plants.giant_flower.seed.display_name)",
"description": "i18n(swamp_goblins:entities.plants.giant_flower.seed.description)",
"icon": "file(seed.png)",
"category": "seed"
}
Expand Down
54 changes: 27 additions & 27 deletions entities/plants/giant_flower/seed/seed_iconic.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"mixins": "stonehearth:mixins:item_properties",
"type": "entity",
"components": {
"model_variants": {
"default": {
"models": [
"file(seed_iconic.qb)"
]
}
},
"mob": {
"model_origin": { "x": 0.05, "y": 0, "z": 0.05 }
}
},
"entity_data": {
"stonehearth:catalog": {
"is_item": true,
"category": "seed"
},
"stonehearth:food_decay": {
"initial_decay": {
"min": 100,
"max": 168
}
}
}
}
"mixins": "stonehearth:mixins:item_properties",
"type": "entity",
"components": {
"model_variants": {
"default": {
"models": [
"file(seed_iconic.qb)"
]
}
},
"mob": {
"model_origin": { "x": 0.05, "y": 0, "z": 0.05 }
}
},
"entity_data": {
"stonehearth:catalog": {
"is_item": true,
"category": "seed"
},
"stonehearth:food_decay": {
"initial_decay": {
"min": 100,
"max": 168
}
}
}
}
Binary file modified entities/plants/giant_flower/seed/seed_iconic.qb
Binary file not shown.
37 changes: 12 additions & 25 deletions entities/plants/giant_flower/sprout/sprout.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"mixins": "stonehearth:mixins:placed_object",
"components": {
"render_info": {
"scale": 0.1125
"scale": 0.2
},
"stonehearth:evolve": {},
"model_variants": {
Expand All @@ -14,51 +14,38 @@
}
},
"mob": {
"model_origin": { "x": 0, "y": 0, "z": 0 },
"model_origin": {"x": -0.1, "y": 0, "z": 0.1 },
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 }
},
"destination": {
"region": [
{
"min": {"x": 0, "y": 0, "z": 0 },
"max": {"x": 1, "y": 1, "z": 1 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
],
"adjacency_flags": [
"front_left",
"front_right",
"back_left",
"back_right"
]
},
"region_collision_shape": {
"region": [
{
"min": {"x": -1, "y": 0, "z": 0 },
"max": {"x": 0, "y": 2, "z": 1 }
},
{
"min": {"x": 1, "y": 0, "z": 0 },
"max": {"x": 2, "y": 2, "z": 1 }
},
{
"min": {"x": 0, "y": 0, "z": -1 },
"max": {"x": 1, "y": 2, "z": 2 }
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 2 }
}
]
],
"region_collision_type": "platform"
}
},
"entity_data": {
"stonehearth:evolve_data": {
"next_stage": "archipelago_biome:plants:hibiscus:stem",
"next_stage": "swamp_goblins:plants:giant_flower",
"evolve_time": "1d+13h"
},
"stonehearth:catalog": {
"material_tags":["stockpile_plant"],
"display_name": "i18n(archipelago_biome:entities.plants.hibiscus_plant.sprout.display_name)",
"description": "i18n(archipelago_biome:entities.plants.hibiscus_plant.sprout.description)",
"display_name": "i18n(swamp_goblins:entities.plants.giant_flower.sprout.display_name)",
"description": "i18n(swamp_goblins:entities.plants.giant_flower.sprout.description)",
"category": "plants",
"subject_override": "archipelago_biome:plants:hibiscus"
"subject_override": "swamp_goblins:plants:giant_flower"
},
"stonehearth:appeal": {
"appeal": 1
Expand Down
Binary file modified entities/plants/giant_flower/sprout/sprout.qb
Binary file not shown.
4 changes: 4 additions & 0 deletions jobs/go_away_goblin_worker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mixins": "swamp_goblins:jobs:worker",
"enabled": false
}
2 changes: 1 addition & 1 deletion jobs/index.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jobs": {
"swamp_goblins:jobs:worker": {
"description": "swamp_goblins:jobs:worker"
"description": "file(go_away_goblin_worker.json)"
},
"swamp_goblins:jobs:beast_tamer": {
"description": "swamp_goblins:jobs:beast_tamer"
Expand Down
Binary file modified jobs/shaman/shaman_workbench/shaman_workbench.qb
Binary file not shown.
Loading

0 comments on commit 9e55342

Please sign in to comment.