Skip to content

Commit

Permalink
Added upgraded staff
Browse files Browse the repository at this point in the history
Can now set speech bubbles to attacks (abilities) used
Goblins will never spawn with just 1 spirit (2 or more)
  • Loading branch information
BrunoSupremo committed Oct 12, 2019
1 parent 00db133 commit f161e02
Show file tree
Hide file tree
Showing 28 changed files with 346 additions and 118 deletions.
15 changes: 15 additions & 0 deletions data/effects/spirit_walker/upgraded_staff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "effect",
"tracks": {
"upgraded_staff": {
"type": "cubemitter",
"cubemitter": "/swamp_goblins/data/horde/particles/spirit_walker/upgraded_staff.json",
"loop": true,
"transforms": { "x": 0, "y": 0, "z": 0,
"rx": 0,
"ry": 0,
"rz": 0
}
}
}
}
2 changes: 1 addition & 1 deletion data/firefly_clan_population.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"max": 5
},
"spirit": {
"min": 1,
"min": 2,
"max": 8
}
}
Expand Down
72 changes: 72 additions & 0 deletions data/horde/particles/spirit_walker/upgraded_staff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "droplets",
"duration": 8000,
"material": "materials/cubemitter_add_bloom.material.json",
"loops": true,
"emission": {
"rate": {
"kind": "CONSTANT",
"values": [50]
},
"angle": {
"kind": "CONSTANT",
"values": [0]
},
"origin": {
"surface": "POINT"
},
"translation_z": {
"kind": "CONSTANT",
"values": [-1.1]
}
},
"particle": {
"lifetime": {
"start": {
"kind": "RANDOM_BETWEEN",
"values": [1750, 2000]
}
},
"speed": {
"start": {
"kind": "CONSTANT",
"values": [2]
}
},
"scale": {
"start": {
"kind": "CONSTANT",
"values": [0.2]
},
"over_lifetime": {
"kind": "CURVE",
"values": [
[0, 1.5],
[0.03, 1.5],
[0.04, 1],
[1, 0]
]
}
},
"color": {
"over_lifetime": {
"kind": "CURVE",
"values": [
[0, 0.922, 0.935, 0.969],
[0.25, 0.174, 0.436, 0.948],
[1, 0.219, 0.179, 0.868]
]
},
"over_lifetime_a": {
"kind": "CURVE",
"values": [
[0, 0],
[0.02, 0.6],
[0.05, 0],
[0.5, 0.25],
[1, 0]
]
}
}
}
}
14 changes: 0 additions & 14 deletions jobs/beast_tamer/beast_tamer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ end
function BeastTamerClass:summon_big_wolf(delay)
local uris = {"swamp_goblins:summons:big_wolf"}
self:summon_animals(delay, uris, 1, true)
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_big_wolf.png")
end

function BeastTamerClass:summon_dragon_aura(delay)
local uris = {"swamp_goblins:summons:dragon_aura"}
self:summon_animals(delay, uris, 1, true)
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_dragon_aura.png")
end

function BeastTamerClass:summon_firefly(delay, target)
Expand All @@ -86,13 +84,11 @@ function BeastTamerClass:summon_firefly(delay, target)
radiant.entities.add_buff(entity, "swamp_goblins:buffs:firefly_confusion")
end
end
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_firefly.png")
end

function BeastTamerClass:summon_varanus(delay)
local uris = {"swamp_goblins:summons:varanus"}
self:summon_animals(delay, uris, 2)
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_varanus.png")
end

function BeastTamerClass:summon_traps(delay, target)
Expand All @@ -115,7 +111,6 @@ function BeastTamerClass:summon_traps(delay, target)
end
end
end
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_traps.png")
end

function BeastTamerClass:summon_wildlife(delay)
Expand All @@ -130,13 +125,11 @@ function BeastTamerClass:summon_wildlife(delay)
"swamp_goblins:summons:squirrel"
}
self:summon_animals(delay, uris, 6)
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_wildlife.png")
end

function BeastTamerClass:summon_poyos(delay)
local uris = {"swamp_goblins:summons:poyo"}
self:summon_animals(delay, uris, 4)
self:thought_bubble("/swamp_goblins/jobs/beast_tamer/images/summon_poyos.png")
end

function BeastTamerClass:summon_animals(delay, uris, amount, has_attributes)
Expand Down Expand Up @@ -171,11 +164,4 @@ function BeastTamerClass:copy_menace(animal)
radiant.entities.set_attribute(animal, "courage", radiant.entities.get_attribute(self._sv._entity, "courage") +1)
end

function BeastTamerClass:thought_bubble(image)
self._sv._entity:add_component('stonehearth:thought_bubble')
:add_bubble(stonehearth.constants.thought_bubble.effects.INDICATOR,
stonehearth.constants.thought_bubble.priorities.HUNGER+1,
image, nil, '5m')
end

return BeastTamerClass
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_big_wolf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 1
"priority": 1,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_big_wolf.png"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 1
"priority": 1,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_dragon_aura.png"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_firefly.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 50000,
"priority": 2
"priority": 2,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_firefly.png"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_poyos.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 6
"priority": 6,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_poyos.png"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_traps.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 4
"priority": 4,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_traps.png"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_varanus.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 3
"priority": 3,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_varanus.png"
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion jobs/beast_tamer/beast_tamer_abilities/summon_wildlife.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 5
"priority": 5,
"image": "/swamp_goblins/jobs/beast_tamer/images/summon_wildlife.png"
}
]
}
Expand Down
27 changes: 27 additions & 0 deletions jobs/earthmaster/recipes/equipments/upgraded_staff_recipe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "recipe",
"effort": 66,
"work_units": 5,
"recipe_name": "i18n(swamp_goblins:jobs.spirit_walker.upgraded_staff.display_name)",
"description": "i18n(swamp_goblins:jobs.spirit_walker.upgraded_staff.description)",
"flavor": "i18n(swamp_goblins:jobs.spirit_walker.upgraded_staff.flavor)",
"portrait": "/swamp_goblins/jobs/spirit_walker/upgraded_staff/upgraded_staff.png",
"workshop": "swamp_goblins:earthmaster:workbench",
"work_effect": "fiddle",
"level_requirement": 4,
"ingredients": [
{
"uri": "swamp_goblins:spirit_walker:talisman",
"count": 1
},
{
"uri": "swamp_goblins:refined:jewel",
"count": 1
}
],
"produces": [
{
"item": "swamp_goblins:spirit_walker:upgraded_staff"
}
]
}
3 changes: 3 additions & 0 deletions jobs/earthmaster/recipes/recipes.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"recipes": {
"magma_sword": {
"recipe": "file(equipments/magma_sword_recipe.json)"
},
"upgraded_staff": {
"recipe": "file(equipments/upgraded_staff_recipe.json)"
}
}
},
Expand Down
44 changes: 17 additions & 27 deletions jobs/spirit_walker/spirit_walker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@ local SpiritWalkerClass = class()
radiant.mixin(SpiritWalkerClass, ClericJob)
local Point3 = _radiant.csg.Point3
local conversation_subjects = {
"stonehearth:subjects:cult",
"stonehearth:subjects:darkness",
"stonehearth:subjects:death",
"stonehearth:cleric:talisman",
"stonehearth:loot:dusty_tome",
"stonehearth:npc:herald:untz",
"stonehearth:monsters:forest:alligator",
"swamp_goblins:beast_tamer:talisman",
"swamp_goblins:bonesmith:talisman",
"swamp_goblins:earthmaster:talisman",
"swamp_goblins:scavenger:talisman",
"swamp_goblins:shaman:talisman",
"swamp_goblins:spirit_walker:talisman",
"swamp_goblins:warrior:talisman"
"stonehearth:subjects:cult",
"stonehearth:subjects:darkness",
"stonehearth:subjects:death",
"stonehearth:cleric:talisman",
"stonehearth:loot:dusty_tome",
"stonehearth:npc:herald:untz",
"stonehearth:monsters:forest:alligator",
"swamp_goblins:beast_tamer:talisman",
"swamp_goblins:bonesmith:talisman",
"swamp_goblins:earthmaster:talisman",
"swamp_goblins:scavenger:talisman",
"swamp_goblins:shaman:talisman",
"swamp_goblins:spirit_walker:talisman",
"swamp_goblins:warrior:talisman"
}

function SpiritWalkerClass:summon_big_g(delay)
local summoning_delay = (delay * 33.3)
stonehearth.combat:set_timer("SpiritWalkerClass summoning_delay: big_g", summoning_delay, function()
self:create_spirit("swamp_goblins:summons:big_g", "double")
end)
self:thought_bubble("/swamp_goblins/jobs/spirit_walker/images/summon_big_g.png")
end)
end

function SpiritWalkerClass:summon_spirit(delay, amount)
Expand All @@ -37,15 +36,13 @@ function SpiritWalkerClass:summon_spirit(delay, amount)
local summoning_delay = (delay * 33.3 * offset)
stonehearth.combat:set_timer("SpiritWalkerClass summoning_delay: "..i, summoning_delay, function()
self:create_spirit("swamp_goblins:summons:goblin_spirit", "copy")
end)
end)
end
self:thought_bubble("/swamp_goblins/jobs/spirit_walker/images/summon_spirit.png")
end

function SpiritWalkerClass:summon_spirits(delay)
local spirit_amount = radiant.entities.get_attribute(self._sv._entity, "spirit")
self:summon_spirit(delay, spirit_amount)
self:thought_bubble("/swamp_goblins/jobs/spirit_walker/images/summon_spirits.png")
end

function SpiritWalkerClass:create_spirit(url, attributes)
Expand All @@ -71,7 +68,7 @@ function SpiritWalkerClass:create_spirit(url, attributes)
subjects:add_override({
subject = subject_uri,
sentiment = 1
})
})
end
radiant.entities.add_buff(spirit, "swamp_goblins:buffs:despawn:in_2h")
end
Expand Down Expand Up @@ -100,11 +97,4 @@ function SpiritWalkerClass:dragon_aura(args)
radiant.events.trigger_async(stonehearth.job, 'swamp_goblins:spirit_walker_dragon_aura')
end

function SpiritWalkerClass:thought_bubble(image)
self._sv._entity:add_component('stonehearth:thought_bubble')
:add_bubble(stonehearth.constants.thought_bubble.effects.INDICATOR,
stonehearth.constants.thought_bubble.priorities.HUNGER+1,
image, nil, '5m')
end

return SpiritWalkerClass
3 changes: 2 additions & 1 deletion jobs/spirit_walker/spirit_walker_abilities/summon_big_g.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 3
"priority": 3,
"image": "/swamp_goblins/jobs/spirit_walker/images/summon_big_g.png"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 5
"priority": 5,
"image": "/swamp_goblins/jobs/spirit_walker/images/summon_spirit.png"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"effect": "emote_roar",
"active_frame": 60,
"cooldown": 70000,
"priority": 4
"priority": 4,
"image": "/swamp_goblins/jobs/spirit_walker/images/summon_spirits.png"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"postures": [
"stonehearth:combat",
"stonehearth:patrol"
]
],
"ilevel": 4,
"roles": ["goblin_spirit_walker_job"],
"no_drop": true
}
},
"entity_data": {
Expand Down
Loading

0 comments on commit f161e02

Please sign in to comment.