diff --git a/data/effects/spirit_walker/upgraded_staff.json b/data/effects/spirit_walker/upgraded_staff.json new file mode 100644 index 0000000..6006115 --- /dev/null +++ b/data/effects/spirit_walker/upgraded_staff.json @@ -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 + } + } + } +} \ No newline at end of file diff --git a/data/firefly_clan_population.json b/data/firefly_clan_population.json index df7ae66..4dc0aa8 100644 --- a/data/firefly_clan_population.json +++ b/data/firefly_clan_population.json @@ -230,7 +230,7 @@ "max": 5 }, "spirit": { - "min": 1, + "min": 2, "max": 8 } } diff --git a/data/horde/particles/spirit_walker/upgraded_staff.json b/data/horde/particles/spirit_walker/upgraded_staff.json new file mode 100644 index 0000000..6c23b0f --- /dev/null +++ b/data/horde/particles/spirit_walker/upgraded_staff.json @@ -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] + ] + } + } + } +} \ No newline at end of file diff --git a/jobs/beast_tamer/beast_tamer.lua b/jobs/beast_tamer/beast_tamer.lua index 953efdb..2355e04 100644 --- a/jobs/beast_tamer/beast_tamer.lua +++ b/jobs/beast_tamer/beast_tamer.lua @@ -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) @@ -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) @@ -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) @@ -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) @@ -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 \ No newline at end of file diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_big_wolf.json b/jobs/beast_tamer/beast_tamer_abilities/summon_big_wolf.json index f403108..c1f2d6b 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_big_wolf.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_big_wolf.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_dragon_aura.json b/jobs/beast_tamer/beast_tamer_abilities/summon_dragon_aura.json index 3f2bd83..3480fa1 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_dragon_aura.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_dragon_aura.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_firefly.json b/jobs/beast_tamer/beast_tamer_abilities/summon_firefly.json index 0aea237..5452ee2 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_firefly.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_firefly.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_poyos.json b/jobs/beast_tamer/beast_tamer_abilities/summon_poyos.json index c836b77..a727eaa 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_poyos.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_poyos.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_traps.json b/jobs/beast_tamer/beast_tamer_abilities/summon_traps.json index d9a55a3..5fa2e98 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_traps.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_traps.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_varanus.json b/jobs/beast_tamer/beast_tamer_abilities/summon_varanus.json index 5d0a202..991ba39 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_varanus.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_varanus.json @@ -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" } ] } diff --git a/jobs/beast_tamer/beast_tamer_abilities/summon_wildlife.json b/jobs/beast_tamer/beast_tamer_abilities/summon_wildlife.json index cbf0fc8..754e534 100644 --- a/jobs/beast_tamer/beast_tamer_abilities/summon_wildlife.json +++ b/jobs/beast_tamer/beast_tamer_abilities/summon_wildlife.json @@ -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" } ] } diff --git a/jobs/earthmaster/recipes/equipments/upgraded_staff_recipe.json b/jobs/earthmaster/recipes/equipments/upgraded_staff_recipe.json new file mode 100644 index 0000000..e47d281 --- /dev/null +++ b/jobs/earthmaster/recipes/equipments/upgraded_staff_recipe.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/jobs/earthmaster/recipes/recipes.json b/jobs/earthmaster/recipes/recipes.json index c59d8fd..3a94e15 100644 --- a/jobs/earthmaster/recipes/recipes.json +++ b/jobs/earthmaster/recipes/recipes.json @@ -24,6 +24,9 @@ "recipes": { "magma_sword": { "recipe": "file(equipments/magma_sword_recipe.json)" + }, + "upgraded_staff": { + "recipe": "file(equipments/upgraded_staff_recipe.json)" } } }, diff --git a/jobs/spirit_walker/spirit_walker.lua b/jobs/spirit_walker/spirit_walker.lua index 0dfdb09..1ecdb9a 100644 --- a/jobs/spirit_walker/spirit_walker.lua +++ b/jobs/spirit_walker/spirit_walker.lua @@ -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) @@ -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) @@ -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 @@ -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 \ No newline at end of file diff --git a/jobs/spirit_walker/spirit_walker_abilities/summon_big_g.json b/jobs/spirit_walker/spirit_walker_abilities/summon_big_g.json index 178f656..661925d 100644 --- a/jobs/spirit_walker/spirit_walker_abilities/summon_big_g.json +++ b/jobs/spirit_walker/spirit_walker_abilities/summon_big_g.json @@ -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" } ] } diff --git a/jobs/spirit_walker/spirit_walker_abilities/summon_spirit.json b/jobs/spirit_walker/spirit_walker_abilities/summon_spirit.json index 2529557..bd907f4 100644 --- a/jobs/spirit_walker/spirit_walker_abilities/summon_spirit.json +++ b/jobs/spirit_walker/spirit_walker_abilities/summon_spirit.json @@ -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" } ] } diff --git a/jobs/spirit_walker/spirit_walker_abilities/summon_spirits.json b/jobs/spirit_walker/spirit_walker_abilities/summon_spirits.json index 4e2da9f..5ecd349 100644 --- a/jobs/spirit_walker/spirit_walker_abilities/summon_spirits.json +++ b/jobs/spirit_walker/spirit_walker_abilities/summon_spirits.json @@ -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" } ] } diff --git a/jobs/spirit_walker/spirit_walker_staff/spirit_walker_staff.json b/jobs/spirit_walker/spirit_walker_staff/spirit_walker_staff.json index 32318a8..3e3ef52 100644 --- a/jobs/spirit_walker/spirit_walker_staff/spirit_walker_staff.json +++ b/jobs/spirit_walker/spirit_walker_staff/spirit_walker_staff.json @@ -18,7 +18,10 @@ "postures": [ "stonehearth:combat", "stonehearth:patrol" - ] + ], + "ilevel": 4, + "roles": ["goblin_spirit_walker_job"], + "no_drop": true } }, "entity_data": { diff --git a/jobs/spirit_walker/upgraded_staff/upgraded_staff.json b/jobs/spirit_walker/upgraded_staff/upgraded_staff.json new file mode 100644 index 0000000..a2cc0df --- /dev/null +++ b/jobs/spirit_walker/upgraded_staff/upgraded_staff.json @@ -0,0 +1,72 @@ +{ + "type": "entity", + "mixins": "stonehearth:mixins:item_properties", + "components": { + "render_info": { + "color_map": "stonehearth:color_map:magic", + "material_maps": [ + "/stonehearth/data/materials/material_maps/magic_material_map.json" + ] + }, + "model_variants": { + "default": { + "models": [ + "file(upgraded_staff_equipped.qb)" + ] + } + }, + "stonehearth:entity_forms": { + "iconic_form": "file(upgraded_staff_iconic.json)" + }, + "stonehearth:equipment_piece": { + "slot": "mainhand", + "render_type": "attach_to_bone", + "postures": [ + "stonehearth:combat", + "stonehearth:patrol" + ], + "ilevel": 5, + "roles": ["goblin_spirit_walker_job"], + "equip_effect": "stonehearth:effects:weapon_level_up" + }, + "effect_list": { + "default": "swamp_goblins:effects:upgraded_staff" + } + }, + "entity_data": { + "stonehearth:combat:weapon_data": { + "base_damage": 5, + "range": 31, + "reach": 1.6 + }, + "stonehearth:combat:healing_data": { + "base_healing": 6 + }, + "stonehearth:combat:melee_attacks": [ + { + "name": "combat_1h_forehand", + "effect": "combat_1h_forehand", + "active_frame": 16, + "cooldown": 0, + "priority": 0 + } + ], + "stonehearth:net_worth": { + "value_in_gold": 31, + "rarity": "common", + "shop_info": { + "buyable": true, + "sellable": true, + "shopkeeper_level": 3, + "shopkeeper_type": "caravan" + } + }, + "stonehearth:catalog": { + "display_name": "i18n(swamp_goblins:jobs.spirit_walker.upgraded_staff.display_name)", + "description": "i18n(swamp_goblins:jobs.spirit_walker.upgraded_staff.description)", + "icon": "file(upgraded_staff.png)", + "category": "weapons", + "material_tags": ["firefly_made", "tool", "melee_weapon", "crafted", "stockpile_weapon"] + } + } +} \ No newline at end of file diff --git a/jobs/spirit_walker/upgraded_staff/upgraded_staff.png b/jobs/spirit_walker/upgraded_staff/upgraded_staff.png new file mode 100644 index 0000000..d67a07c Binary files /dev/null and b/jobs/spirit_walker/upgraded_staff/upgraded_staff.png differ diff --git a/jobs/spirit_walker/upgraded_staff/upgraded_staff.qb b/jobs/spirit_walker/upgraded_staff/upgraded_staff.qb new file mode 100644 index 0000000..170838d Binary files /dev/null and b/jobs/spirit_walker/upgraded_staff/upgraded_staff.qb differ diff --git a/jobs/spirit_walker/upgraded_staff/upgraded_staff_equipped.qb b/jobs/spirit_walker/upgraded_staff/upgraded_staff_equipped.qb new file mode 100644 index 0000000..e1675fe Binary files /dev/null and b/jobs/spirit_walker/upgraded_staff/upgraded_staff_equipped.qb differ diff --git a/jobs/spirit_walker/upgraded_staff/upgraded_staff_iconic.json b/jobs/spirit_walker/upgraded_staff/upgraded_staff_iconic.json new file mode 100644 index 0000000..341c951 --- /dev/null +++ b/jobs/spirit_walker/upgraded_staff/upgraded_staff_iconic.json @@ -0,0 +1,20 @@ +{ + "type": "entity", + "mixins": "stonehearth:mixins:item_properties", + "components": { + "model_variants": { + "default": { + "models": [ + "file(upgraded_staff.qb)" + ] + } + } + }, + "entity_data": { + "stonehearth:catalog": { + "icon": "file(upgraded_staff.png)", + "is_item": true, + "category": "weapons" + } + } +} \ No newline at end of file diff --git a/locales/en.json b/locales/en.json index 53d0848..748cb8b 100644 --- a/locales/en.json +++ b/locales/en.json @@ -941,6 +941,11 @@ "flavor": "Promotes a goblin to Spirit Walker" }, "description": "Scary mace weapon" + }, + "upgraded_staff": { + "display_name": "Spirit Walker Upgraded Staff", + "description": "Upgraded weapon", + "flavor": "" } }, "shadow_walker": { diff --git a/manifest.json b/manifest.json index a36839e..3d31a78 100644 --- a/manifest.json +++ b/manifest.json @@ -198,6 +198,7 @@ "effects:mosquito_cloud":"file(data/effects/mosquito_cloud)", "effects:shaman_workbench_effect":"file(data/effects/shaman_workbench_effect)", "effects:spirit_walker":"file(data/effects/spirit_walker)", + "effects:upgraded_staff":"file(data/effects/spirit_walker/upgraded_staff.json)", "effects:spirit:goblin_spirit": "file(data/effects/spirit/goblin_spirit.json)", "effects:spirit:big_g": "file(data/effects/spirit/big_g.json)", "effects:spirit:dragon_aura": "file(data/effects/spirit/dragon_aura.json)", @@ -329,6 +330,7 @@ "skeletons:humanoid:baby":"file(data/rigs/entities/humans/skeletons/baby.json)", "spirit_walker:staff": "file(jobs/spirit_walker/spirit_walker_staff)", + "spirit_walker:upgraded_staff": "file(jobs/spirit_walker/upgraded_staff)", "spirit_walker:talisman": "file(jobs/spirit_walker/spirit_walker_staff/spirit_walker_staff_talisman.json)", "spirit_walker:abilities:summon_spirit": "file(jobs/spirit_walker/spirit_walker_abilities/summon_spirit.json)", "spirit_walker:abilities:summon_spirits": "file(jobs/spirit_walker/spirit_walker_abilities/summon_spirits.json)", diff --git a/mixins/base_goblin/base_goblin.json b/mixins/base_goblin/base_goblin.json index 7363867..f50b854 100644 --- a/mixins/base_goblin/base_goblin.json +++ b/mixins/base_goblin/base_goblin.json @@ -21,7 +21,12 @@ "max": 5 }, "spirit": { + "base": 2, "max": 8 + }, + "inspiration": { + "type": "derived", + "equation": "spirit - 4" } } }, diff --git a/services/server/combat/custom_combat_service.lua b/services/server/combat/custom_combat_service.lua index 7c7a0e1..8ca0cbc 100644 --- a/services/server/combat/custom_combat_service.lua +++ b/services/server/combat/custom_combat_service.lua @@ -1,67 +1,86 @@ CustomCombatService = class() function CustomCombatService:_calculate_dart_damage(attacker, target, attack_info) - local weapon = radiant.entities.get_equipped_item(attacker, 'darts_slot') - - if not weapon or not weapon:is_valid() then - return 0 - end - - local weapon_data = radiant.entities.get_entity_data(weapon, 'stonehearth:combat:weapon_data') - local base_damage = weapon_data["base_ranged_damage"] - - local total_damage = base_damage - local attributes_component = attacker:get_component('stonehearth:attributes') - if not attributes_component then - return total_damage - end - local additive_dmg_modifier = attributes_component:get_attribute('additive_dmg_modifier') - local multiplicative_dmg_modifier = attributes_component:get_attribute('multiplicative_dmg_modifier') - local muscle = attributes_component:get_attribute('muscle') - - if muscle then - local muscle_dmg_modifier = muscle * stonehearth.constants.attribute_effects.MUSCLE_MELEE_MULTIPLIER - muscle_dmg_modifier = muscle_dmg_modifier + stonehearth.constants.attribute_effects.MUSCLE_MELEE_MULTIPLIER_BASE - additive_dmg_modifier = additive_dmg_modifier + muscle_dmg_modifier - end - - if multiplicative_dmg_modifier then - local dmg_to_add = base_damage * multiplicative_dmg_modifier - total_damage = dmg_to_add + total_damage - end - if additive_dmg_modifier then - total_damage = total_damage + additive_dmg_modifier - end - - --Get damage from weapons - if attack_info.damage_multiplier then - total_damage = total_damage * attack_info.damage_multiplier - end - - --Get the damage reduction from armor - local total_armor = self:calculate_total_armor(target) - - -- Reduce armor if attacker has armor reduction attributes - local multiplicative_target_armor_modifier = attributes_component:get_attribute('multiplicative_target_armor_modifier', 1) - local additive_target_armor_modifier = attributes_component:get_attribute('additive_target_armor_modifier', 0) - - if attack_info.target_armor_multiplier then - multiplicative_target_armor_modifier = multiplicative_target_armor_modifier * attack_info.target_armor_multiplier - end - - total_armor = total_armor * multiplicative_target_armor_modifier + additive_target_armor_modifier - - local damage = total_damage - total_armor - damage = radiant.math.round(damage) - - if attack_info.minimum_damage and damage <= attack_info.minimum_damage then - damage = attack_info.minimum_damage - elseif damage < 1 then - -- if attack will do less than 1 damage, then randomly it will do either 1 or 0 - damage = rng:get_int(0, 1) - end - - return damage + local weapon = radiant.entities.get_equipped_item(attacker, 'darts_slot') + + if not weapon or not weapon:is_valid() then + return 0 + end + + local weapon_data = radiant.entities.get_entity_data(weapon, 'stonehearth:combat:weapon_data') + local base_damage = weapon_data["base_ranged_damage"] + + local total_damage = base_damage + local attributes_component = attacker:get_component('stonehearth:attributes') + if not attributes_component then + return total_damage + end + local additive_dmg_modifier = attributes_component:get_attribute('additive_dmg_modifier') + local multiplicative_dmg_modifier = attributes_component:get_attribute('multiplicative_dmg_modifier') + local muscle = attributes_component:get_attribute('muscle') + + if muscle then + local muscle_dmg_modifier = muscle * stonehearth.constants.attribute_effects.MUSCLE_MELEE_MULTIPLIER + muscle_dmg_modifier = muscle_dmg_modifier + stonehearth.constants.attribute_effects.MUSCLE_MELEE_MULTIPLIER_BASE + additive_dmg_modifier = additive_dmg_modifier + muscle_dmg_modifier + end + + if multiplicative_dmg_modifier then + local dmg_to_add = base_damage * multiplicative_dmg_modifier + total_damage = dmg_to_add + total_damage + end + if additive_dmg_modifier then + total_damage = total_damage + additive_dmg_modifier + end + + --Get damage from weapons + if attack_info.damage_multiplier then + total_damage = total_damage * attack_info.damage_multiplier + end + + --Get the damage reduction from armor + local total_armor = self:calculate_total_armor(target) + + -- Reduce armor if attacker has armor reduction attributes + local multiplicative_target_armor_modifier = attributes_component:get_attribute('multiplicative_target_armor_modifier', 1) + local additive_target_armor_modifier = attributes_component:get_attribute('additive_target_armor_modifier', 0) + + if attack_info.target_armor_multiplier then + multiplicative_target_armor_modifier = multiplicative_target_armor_modifier * attack_info.target_armor_multiplier + end + + total_armor = total_armor * multiplicative_target_armor_modifier + additive_target_armor_modifier + + local damage = total_damage - total_armor + damage = radiant.math.round(damage) + + if attack_info.minimum_damage and damage <= attack_info.minimum_damage then + damage = attack_info.minimum_damage + elseif damage < 1 then + -- if attack will Do less than 1 damage, Then randomly it will Do either 1 or 0 + damage = rng:get_int(0, 1) + end + + return damage +end + +function CustomCombatService:start_cooldown(entity, action_info) + local combat_state = self:get_combat_state(entity) + if not combat_state then + return + end + combat_state:start_cooldown(action_info.name, action_info.cooldown) + + if action_info.image then + self:thought_bubble(entity, action_info.image) + end +end + +function CustomCombatService:thought_bubble(entity,image) + 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 CustomCombatService \ No newline at end of file diff --git a/swamp_goblins_server.lua b/swamp_goblins_server.lua index 9e86e37..2d9e245 100644 --- a/swamp_goblins_server.lua +++ b/swamp_goblins_server.lua @@ -1,5 +1,5 @@ swamp_goblins = {} -print("Swamp Goblins Mod version 19.10.1") +print("Swamp Goblins Mod version 19.10.11") --[[ @@ -7,15 +7,14 @@ cultist seeks fireflies bonus when playing at home biome -firefly jewels for ornate stuff (like gold flakes) - mosquito model banner shred animals haulers requiring food and care slimes varanus/mobs repelent -use ace tools and tools upgrades +add ace tools and tools upgrades +add ace bone decor contruction: door, double door