Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
Fixed crab traps being locked/unusable after save and reload
Fixed invisible object (fish) sold by merchants

Linked fishing data to the fisher_description.json file, allowing individual kingdoms to have their own loot
Added 4th level perk for the fisher
  • Loading branch information
BrunoSupremo committed Jan 27, 2019
1 parent 8c086c7 commit 85e2e86
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 36 deletions.
6 changes: 2 additions & 4 deletions archipelago_biome_server.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
archipelago_biome = {}
local log = radiant.log.create_logger('version')
log:error("Archipelago Biome Mod version 19.1.20")
print("Archipelago Biome Mod version 19.1.27")

function archipelago_biome:_on_required_loaded()
end
Expand Down Expand Up @@ -32,6 +31,5 @@ end
radiant.events.listen_once(radiant, 'radiant:services:init', archipelago_biome, archipelago_biome._on_services_init)
radiant.events.listen_once(radiant, 'radiant:required_loaded', archipelago_biome, archipelago_biome._on_required_loaded)
radiant.events.listen_once(radiant, 'stonehearth:biome_set', archipelago_biome, archipelago_biome._on_biome_set)
radiant.util.set_global_config('mods.directory.cfm.enabled', false)
radiant.util.set_global_config('mods.steam_workshop.cfm.enabled', false)

return archipelago_biome
18 changes: 14 additions & 4 deletions components/crab_spawner/crab_spawner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ function ArchipelagoCrabSpawner:activate()
self._on_added_to_world_listener = radiant.events.listen(self._entity, 'archipelago_biome:in_the_water', self, self.activate_the_spawner)
end

self:ready_to_harvest(false)
if self:has_child() then
self:ready_to_harvest(true)
else
self:ready_to_harvest(false)
end
end

function ArchipelagoCrabSpawner:activate_the_spawner()
Expand Down Expand Up @@ -60,15 +64,21 @@ function ArchipelagoCrabSpawner:spawner_removed()
end
end

function ArchipelagoCrabSpawner:try_to_spawn_crab()
-- log:error("try_to_spawn_crab")
function ArchipelagoCrabSpawner:has_child()
local ec = self._entity:get_component("entity_container")
if ec then
for id, child in ec:each_child() do
--if it has a child (trapped) it should do nothing, just wait until it is harvested.
return
return true
end
end
return false
end

function ArchipelagoCrabSpawner:try_to_spawn_crab()
if self:has_child() then
return
end
local location = radiant.entities.get_world_grid_location(self._entity)
if not location then
-- log:error("try_to_spawn_crab nil location")
Expand Down
Binary file modified data/biome/images/archipelago_story_board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions entities/food/big_fish/big_fish.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
},
"stonehearth:net_worth": {
"value_in_gold": 7,
"rarity": "common",
"shop_info": {
"buyable": true,
"sellable": true,
"shopkeeper_level": 2,
"shopkeeper_type": "caravan"
}
},
"stonehearth:catalog": {
Expand Down
10 changes: 10 additions & 0 deletions entities/food/fish/fish.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
}
},
"entity_data": {
"stonehearth:net_worth": {
"value_in_gold": 3,
"rarity": "common",
"shop_info": {
"buyable": true,
"sellable": true,
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:catalog": {
"display_name": "i18n(archipelago_biome:entities.food.fish.display_name)",
"description": "i18n(archipelago_biome:entities.food.fish.description)",
Expand Down
6 changes: 5 additions & 1 deletion entities/food/nemo/nemo.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
},
"stonehearth:net_worth": {
"value_in_gold": 30,
"rarity": "common",
"shop_info": {
"buyable": false
"buyable": false,
"sellable": true,
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:catalog": {
Expand Down
6 changes: 5 additions & 1 deletion entities/food/tropical_fish/tropical_fish.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@
"entity_data": {
"stonehearth:net_worth": {
"value_in_gold": 4,
"rarity": "common",
"shop_info": {
"shopkeeper_level": 2
"buyable": true,
"sellable": true,
"shopkeeper_level": 2,
"shopkeeper_type": "caravan"
}
},
"stonehearth:catalog": {
Expand Down
7 changes: 0 additions & 7 deletions jobs/firefly_index.json

This file was deleted.

4 changes: 0 additions & 4 deletions jobs/fisher/firefly_fisher_description.json

This file was deleted.

5 changes: 4 additions & 1 deletion jobs/fisher/fisher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ end

function FisherClass:activate()
BaseJob.activate(self)
self.fishing_data = radiant.resources.load_json("archipelago_biome:data:fishing", true)
self.biome_alias = stonehearth.world_generation:get_biome_alias()
self.player_id = radiant.entities.get_player_id(self._sv._entity)
self.kingdom_alias = stonehearth.player:get_kingdom(self.player_id)
end

function FisherClass:post_activate()
self.fishing_data = radiant.resources.load_json(self._job_component:get_job_data().fishing_data, true)
end

function FisherClass:chose_random_fish()
local function has_filter( key, value )
local valid = false
Expand Down
12 changes: 12 additions & 0 deletions jobs/fisher/fisher_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"craft_level_5": 15,
"craft_level_6": 17
},
"fishing_data": "archipelago_biome:data:fishing",
"max_level": 6,
"level_data": {
"1": {
Expand Down Expand Up @@ -80,6 +81,17 @@
"level": 3
}
]
},
"4": {
"perks": [
{
"name": "i18n(archipelago_biome:jobs.fisher.fisher_description.level_4.perk_name)",
"id": "crafter_recipe_unlock_4",
"icon": "file(images/faster_fishing_perk.png)",
"description": "i18n(archipelago_biome:jobs.fisher.fisher_description.level_4.perk_description)",
"level": 4
}
]
}
}
}
Binary file added jobs/fisher/images/faster_fishing_perk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion jobs/index.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"jobs": {
"archipelago_biome:jobs:fisher": {
"description": "archipelago_biome:jobs:fisher"
"description": "archipelago_biome:jobs:fisher",
"firefly_job":"shared"
}
}
}
4 changes: 4 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@
"level_3": {
"perk_name": "Cooking",
"perk_description": "With a small firepit, the fisher can cook basic recipes."
},
"level_4": {
"perk_name": "Faster",
"perk_description": "With each level, fishing gets faster, with less time waiting for a bite."
}
},
"fisher_bucket": {
Expand Down
4 changes: 4 additions & 0 deletions locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@
"level_3": {
"perk_name": "Cozinhando",
"perk_description": "Com uma fogueirinha, o pescador consegue cozinhar receitas básicas."
},
"level_4": {
"perk_name": "Mais rápido",
"perk_description": "A cada nível, pescar fica mais rápido, com menos tempo esperando uma mordida."
}
},
"fisher_bucket":{
Expand Down
5 changes: 2 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@

"jobs:index": "file(jobs/index.json)",
"jobs:fisher": "file(jobs/fisher/fisher_description.json)",
"jobs:firefly_fisher": "file(jobs/fisher/firefly_fisher_description.json)",
"fisher:rod": "file(jobs/fisher/fisher_rod/fisher_rod.json)",
"fisher:talisman": "file(jobs/fisher/fisher_bucket/fisher_bucket_talisman.json)",
"fisher:workbench": "file(jobs/fisher/fisher_workbench)",
Expand Down Expand Up @@ -246,7 +245,8 @@
},
"deprecated_aliases": {
"decoration:hammock":"file(entities/decoration/hammock)",
"landmark:summon_stone:minor:tropical_island": "file(entities/landmark/summon_stone_tropical_island)"
"landmark:summon_stone:minor:tropical_island": "file(entities/landmark/summon_stone_tropical_island)",
"jobs:firefly_fisher": "file(jobs/fisher/fisher_description.json)",
},
"mixintos": {
"stonehearth:biome:index": "file(data/biome/index.json)",
Expand Down Expand Up @@ -310,7 +310,6 @@
"stonehearth:farmer:all_crops": "file(services/server/farming/data/all_crops.json)",

"stonehearth:jobs:index": "archipelago_biome:jobs:index",
"swamp_goblins:jobs:index": "file(jobs/firefly_index.json)",
"stonehearth/jobs/blacksmith/recipes/recipes.json": "file(jobs/blacksmith/recipes)",
"stonehearth/jobs/carpenter/recipes/recipes.json": "file(jobs/carpenter/recipes)",
"stonehearth/jobs/cook/recipes/recipes.json": "file(jobs/cook/recipes)",
Expand Down
10 changes: 0 additions & 10 deletions mixins/fish/fish.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
},
"rotten_entity_alias": "archipelago_biome:food:fish:rotten"
},
"stonehearth:net_worth": {
"value_in_gold": 3,
"rarity": "common",
"shop_info": {
"buyable": true,
"sellable": true,
"shopkeeper_level": 1,
"shopkeeper_type": "caravan"
}
},
"stonehearth:catalog": {
"is_item": true,
"category": "cooking_ingredient",
Expand Down

0 comments on commit 85e2e86

Please sign in to comment.