Skip to content

Commit

Permalink
coconut helmet finished
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoSupremo committed Feb 16, 2021
1 parent bdc2d2c commit 3f39158
Show file tree
Hide file tree
Showing 26 changed files with 161 additions and 69 deletions.
5 changes: 2 additions & 3 deletions archipelago_biome_server.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
archipelago_biome = {}
print("Archipelago Biome Mod version 20.12.5")
print("Archipelago Biome Mod version 21.2.15")

--[[
redo dock urgent, it is ugly
fish anywhere near water, docks will be just a prefered place
fish anywhere near water, docks will be just a prefered place
seaweed seeds
seaweed ace farm
Expand Down
49 changes: 13 additions & 36 deletions components/dock/dock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ local ArchipelagoDock = class()
local VERSIONS = {
ZERO = 0,
DOCK_SPOT_FOR_MULTIPLAYER = 1,
SAVED_LEGS = 2
SAVED_LEGS = 2,
NO_LEGS = 3
}

function ArchipelagoDock:get_version()
return VERSIONS.SAVED_LEGS
return VERSIONS.NO_LEGS
end

function ArchipelagoDock:fixup_post_load(old_save_data)
Expand All @@ -28,19 +29,26 @@ function ArchipelagoDock:fixup_post_load(old_save_data)
end
end
end
if old_save_data.version < VERSIONS.NO_LEGS then
--docks do not have legs anymore
self._delay = radiant.on_game_loop_once('NO_LEGS delay', function()
for i,v in ipairs(self._sv.saved_legs) do
radiant.entities.destroy_entity(v)
end
self._sv.saved_legs = nil
end)
end
end

function ArchipelagoDock:initialize()
self._sv.dock_spot = nil
self._sv.saved_legs = {}
self.__saved_variables:mark_changed()
end

function ArchipelagoDock:activate()
local json = radiant.entities.get_json(self)
self.no_legs = json.no_legs or false
self.no_water = json.no_water or false
self.dock_spot_offset = json.dock_spot_offset or -1
self.dock_spot_offset = json.dock_spot_offset or 0
self.reverse_facing = json.reverse_facing

if not self._added_to_world_listener then
Expand All @@ -50,7 +58,6 @@ function ArchipelagoDock:activate()
end
if not self._removed_from_world_listener then
self._removed_from_world_listener = radiant.events.listen(self._entity, 'stonehearth:on_removed_from_world', function()
self:remove_legs()
self:remove_fishing_spot()
end)
end
Expand All @@ -66,9 +73,6 @@ function ArchipelagoDock:on_added_to_world()
--for some reason, location is nil when the on_added event fires,
--so I have to wait 1gametick for it to be set, and it is done running inside this
local location = radiant.entities.get_world_grid_location(self._entity)
if location and not self.no_legs and not next(self._sv.saved_legs) then
self:add_legs(location)
end
if location and self.no_water then
self:add_fishing_spot(location)
end
Expand Down Expand Up @@ -125,34 +129,7 @@ function ArchipelagoDock:remove_fishing_spot()
self.__saved_variables:mark_changed()
end

function ArchipelagoDock:add_legs(location)
local edge = self:_get_dock_edge(self._entity,location)
local facing = radiant.entities.get_facing(self._entity)
local edge_offset = edge - Point3.unit_y
local leg_offset = radiant.math.rotate_about_y_axis( Point3(0, 1, -0.2), facing)
while not radiant.terrain.is_blocked(edge_offset) and edge_offset.y >0 do
--todo: allow other leg types, and random types
local leg = radiant.entities.create_entity("archipelago_biome:decoration:dock_leg",
{owner = self._entity:get_player_id()})
table.insert(self._sv.saved_legs, leg)
radiant.terrain.place_entity_at_exact_location(leg, edge_offset)
local facing = radiant.entities.get_facing(self._entity)
radiant.entities.turn_to(leg, facing)
edge_offset = edge_offset - leg_offset
end
self.__saved_variables:mark_changed()
end

function ArchipelagoDock:remove_legs()
for i,v in ipairs(self._sv.saved_legs) do
radiant.entities.destroy_entity(v)
end
self._sv.saved_legs = {}
self.__saved_variables:mark_changed()
end

function ArchipelagoDock:destroy()
self:remove_legs()
self:remove_fishing_spot()
if self._added_to_world_listener then
self._added_to_world_listener:destroy()
Expand Down
61 changes: 61 additions & 0 deletions data/biome/ace_foraging_spot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"mixins": "stonehearth_ace:terrain:foraging_spot",
"components": {
"stonehearth:resource_node": {
"resource_loot_table": {
"entries": {
"optional": {
"items": {
"nothing": {
"weight": 45
},
"bough": {
"weight": 4
},
"bough_evergreen": {
"weight": 2
},
"random_fungus": {
"type": "bag",
"uri": "stonehearth_ace:loot_bag:foraging:temperate:fungi",
"weight": 5
},
"fiber": {
"uri": "stonehearth:resources:fiber:silkweed_bundle",
"weight": 1
},
"random_herb": {
"uri": "stonehearth:resources:herb:brightbell",
"weight": 5
},
"random_herb2": {
"uri": "archipelago_biome:resources:herb:hibiscus",
"weight": 3
},
"random_herb3": {
"uri": "stonehearth_ace:resources:herb:foxlily",
"weight": 1
},
"coconut": {
"uri": "archipelago_biome:food:coconut",
"weight": 1
},
"random_seed_tree": {
"uri": "archipelago_biome:trees:dranden:seed",
"weight": 0.75
},
"random_seed_tree2": {
"uri": "archipelago_biome:trees:smalea:seed",
"weight": 0.75
},
"random_seed_tree3": {
"uri": "archipelago_biome:trees:papaya:seed",
"weight": 0.25
}
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions data/biome/archipelago.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"generation_file": "file(archipelago_generation_data.json)",
"tower_defense_generation_file": "file(tower_defense/archipelago_generation_data.json)",
"default_starting_season": "dry",
"foraging_spot_uri": "file(ace_foraging_spot.json)",
"seasons": {
"dry": {
"humidity": 0.5,
Expand Down
26 changes: 21 additions & 5 deletions entities/armor/coconut_helmet/coconut_helmet.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
"models": [
"file(coconut_helmet.qb)"
]
},
"female": {
"layer": "hat",
"transparent": "false",
"models": [
"file(coconut_helmet_female.qb)"
]
},
"firefly_goblin": {
"layer": "hat",
"transparent": "false",
"models": [
"file(coconut_helmet_goblin.qb)"
]
}
},
"stonehearth:entity_forms": {
Expand All @@ -18,10 +32,6 @@
"render_type": "merge_with_model",
"slot": "helmet",
"ilevel": 1,
"injected_buffs": [
"stonehearth_ace:buffs:weather:hot_resist",
"stonehearth_ace:buffs:weather:sunstroke_resist"
],
"required_job_level": 1,
"roles":["combat"],
"equip_effect": "stonehearth:effects:weapon_level_up"
Expand All @@ -46,7 +56,13 @@
"description": "i18n(archipelago_biome:entities.armor.coconut_helmet.description)",
"icon": "file(coconut_helmet.png)",
"category": "armor",
"material_tags": ["coconut", "helmet", "armor", "heavy_armor", "stockpile_equipment"]
"material_tags": [
"coconut",
"helmet",
"armor",
"heavy_armor",
"stockpile_equipment"
]
}
}
}
Binary file added entities/armor/coconut_helmet/coconut_helmet.qb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion entities/armor/turtle_shield/turtle_shield.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"stonehearth:have_shield"
],
"ilevel": 2,
"roles":["footman_job"],
"roles":["melee_combat"],
"equip_effect": "stonehearth:effects:weapon_level_up"
}
},
Expand Down
4 changes: 2 additions & 2 deletions entities/decoration/dock/dock.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"nav_preference_modifier": -1.0,
"region": [
{
"min": { "x": -1, "y": 0, "z": -2 },
"min": { "x": -1, "y": 0, "z": -1 },
"max": { "x": 2, "y": 1, "z": 1 }
}
]
},
"region_collision_shape": {
"region": [
{
"min": {"x": -1, "y": 0, "z": -2 },
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 1, "z": 1 }
}
],
Expand Down
Binary file modified entities/decoration/dock/dock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified entities/decoration/dock/dock.qb
Binary file not shown.
12 changes: 6 additions & 6 deletions entities/decoration/dock/dock_ghost.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
}
},
"mob": {
"model_origin": { "x": 0, "y": 0, "z": 1 },
"model_origin": { "x": 0, "y": 0.01, "z": 1 },
"region_origin": { "x": 0.5, "y": 0, "z": 0.5 }
},
"destination": {
"region": [
{
"min": {"x": -1, "y": 0, "z": -2 },
"min": {"x": -1, "y": 0, "z": -1 },
"max": {"x": 2, "y": 3, "z": 1 }
}
],
"adjacent": [
{
"min": {"x": -2, "y": 0, "z": -2 },
"min": {"x": -2, "y": 0, "z": -1 },
"max": {"x": -1, "y": 3, "z": 1 }
},
{
"min": {"x": -1, "y": 0, "z": -3 },
"max": {"x": 2, "y": 3, "z": -2 }
"min": {"x": -1, "y": 0, "z": -2 },
"max": {"x": 2, "y": 3, "z": -1 }
},
{
"min": {"x": -1, "y": 0, "z": 1 },
"max": {"x": 2, "y": 3, "z": 2 }
},
{
"min": {"x": 2, "y": 0, "z": -2 },
"min": {"x": 2, "y": 0, "z": -1 },
"max": {"x": 3, "y": 3, "z": 1 }
}
]
Expand Down
Binary file modified entities/decoration/dock/dock_iconic.qb
Binary file not shown.
1 change: 0 additions & 1 deletion entities/decoration/fish_pond/fish_pond.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
]
},
"archipelago_biome:dock": {
"no_legs":true,
"no_water":true,
"dock_spot_offset":-4,
"reverse_facing":true,
Expand Down
1 change: 0 additions & 1 deletion entities/decoration/ice_dock/ice_dock.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"default": "archipelago_biome:effects:ice_dock_bubbles"
},
"archipelago_biome:dock": {
"no_legs":true,
"no_water":true,
"dock_spot_offset":3
},
Expand Down
9 changes: 8 additions & 1 deletion entities/food/fish_cooked/fish_cooked.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@
"icon": "file(fish_cooked.png)",
"is_item": true,
"category": "food",
"material_tags":["prepared_food", "stockpile_prepared_food", "meat", "food", "fish_cooked"]
"material_tags":[
"prepared_food",
"stockpile_prepared_food",
"meat",
"food",
"fish",
"fish_cooked"
]
},
"stonehearth:appeal": {
"appeal": 1
Expand Down
2 changes: 2 additions & 0 deletions entities/food/sashimi/sashimi.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"material_tags":[
"food",
"raw_food",
"prepared_food",
"meat",
"fish",
"sashimi",
"stockpile_raw_food",
"stockpile_prepared_food"
Expand Down
6 changes: 5 additions & 1 deletion jobs/fisher/fisher_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"torso": "file(fisher_outfit)",
"mainhand": "archipelago_biome:fisher:rod"
},
"roles":["fisher_job", "crafter", "field_work"],
"roles":[
"fisher_job",
"field_work",
"fish_trap_placer"
],
"icon": "file(images/icon.png)",
"task_groups": [
"archipelago_biome:task_groups:fishing",
Expand Down
3 changes: 2 additions & 1 deletion jobs/fisher/fisher_firepit/fisher_firepit_ghost.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"components": {
"mob": {
"model_origin": { "x": 0.5, "y": 0, "z": 0.5 },
"region_origin": { "x": 0.5, "y": 0, "z": 0.5 }
"region_origin": { "x": 0.5, "y": 0, "z": 0.5 },
"allow_vertical_adjacent": false
},
"model_variants": {
"default": {
Expand Down
3 changes: 2 additions & 1 deletion jobs/fisher/fisher_workbench/fisher_workbench_ghost.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"components": {
"mob": {
"model_origin": {"x": 0.5, "y": 0, "z": 0.5 },
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 }
"region_origin": {"x": 0.5, "y": 0, "z": 0.5 },
"allow_vertical_adjacent": false
},
"model_variants": {
"default": {
Expand Down
4 changes: 0 additions & 4 deletions jobs/herbalist/recipes/palm_transmute_recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
{
"uri": "archipelago_biome:food:coconut",
"count": 2
},
{
"uri": "stonehearth:consumables:healing_tonic:small",
"count": 1
}
],
"produces": [
Expand Down
Loading

0 comments on commit 3f39158

Please sign in to comment.