Damage Type on Throwing Weapons
Damage Type on Throwing Weapons
I can't seem to find the correct definition to change the damage type for throwing weapons. For example I am trying to make a throwing knife that does fire damage. Is this possible? I have been able to create elemental based weapons for everything else without issue. Any help would be appreciated.
- Zo Kath Ra
- Posts: 941
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Damage Type on Throwing Weapons
The only solution I can think of is to usemythos wrote:I can't seem to find the correct definition to change the damage type for throwing weapons. For example I am trying to make a throwing knife that does fire damage. Is this possible? I have been able to create elemental based weapons for everything else without issue. Any help would be appreciated.
ItemComponent.onThrowAttackHitMonster(self, monster)
and then spawning a TileDamager on the monster's location.
Re: Damage Type on Throwing Weapons
That's a good suggestion. I found another workground by applying a bombItem class to the weapon. Only problem now is the item is consumed. Is there anyway to edit the bomb mechanics or create a new one that doesn't consume the item?
Thanks!
Thanks!
Re: Damage Type on Throwing Weapons
But (as we know) tile damager would burn the whole troop, not just the target; in cases of grouped attackers.Zo Kath Ra wrote:and then spawning a TileDamager on the monster's location.
*And for that we could as well make a knife shaped fire-bomb... but an over powered one, as it isn't destroyed upon use.
Here is one (if slightly overpowered) way to do a burning throwing knife:
https://www.dropbox.com/s/8n4oufxwktep4 ... e.avi?dl=0
Code: Select all
defineObject{
name = "throwing_knife_fire_effect",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/knife.fbx",
},
{
class = "Item",
gameEffect = "50% chance of immolating the target.",
UiName = "Immolating Throwing Knife",
gfxAtlas = "assets/textures/gui/items_2.tga",
gfxIndex = 28,
impactSound = "impact_blade",
stackable = false, --MUST BE FALSE
sharpProjectile = true,
weight = 0.5,
projectileRotationSpeed = -20,
projectileRotationX = 90,
projectileRotationY = 90,
traits = { "throwing_weapon" },
onEquipItem = function(self, champion, slot) self.go.item:setGameEffect("50% chance of immolating the target.") end,
onThrowAttackHitMonster = function(self, monster)
--optional random failure ~to offset the significant damage a successful immolation attack inflicts.
if math.random() >.5 then
monster.go:createComponent("BurningMonster")
local champ = tonumber(self.go.item:getGameEffect())
if champ and type(champ) == "number" then
monster.go.burningmonster:setCausedByChampion(champ)
--optional
local output = string.gsub(party.party:getChampionByOrdinal(champ):getName().."\'s "..self.go.item:getUiName().." set the "..monster.go.name.." ablaze.", "%d" , " ")
hudPrint(string.gsub(output, "_", " "))
end
end
end,
},
{
class = "ThrowAttack",
attackPower = 9,
cooldown = 4,
onPostAttack = function(self, champion, slot)
self.go.item:setGameEffect(champion:getOrdinal())
end,
},
},
tags = { "weapon", "weapon_throwing" },
}
Last edited by Isaac on Thu Nov 26, 2015 10:42 am, edited 2 times in total.
Re: Damage Type on Throwing Weapons
Perfect! You rock. I can always make it an end game item or something. I just wanted to do something unique with throwing weapons.Isaac wrote:But (as we know) tile damager would burn the whole troop, not just the target; in cases of grouped attackers.Zo Kath Ra wrote:and then spawning a TileDamager on the monster's location.
*And for that we could as well make a knife shaped fire-bomb... but an over powered one, as it isn't destroyed upon use.
Here is one (if slightly overpowered) way to do a burning throwing knife:
https://www.dropbox.com/s/8n4oufxwktep4 ... e.avi?dl=0Code: Select all
defineObject{ name = "throwing_knife_fire_effect", baseObject = "base_item", components = { { class = "Model", model = "assets/models/items/knife.fbx", }, { class = "Item", gameEffect = "50% chance of immolating the target.", UiName = "Immolating Throwing Knife", gfxAtlas = "assets/textures/gui/items_2.tga", gfxIndex = 28, impactSound = "impact_blade", stackable = false, --MUST BE FALSE sharpProjectile = true, weight = 0.5, projectileRotationSpeed = -20, projectileRotationX = 90, projectileRotationY = 90, traits = { "throwing_weapon" }, onEquipItem = function(self, champion, slot) self.go.item:setGameEffect("50% chance of immolating the target.") end, onThrowAttackHitMonster = function(self, monster) --optional random failure ~to offset the significant damage a successful immolation attack inflicts. if math.random() >.5 then monster.go:createComponent("BurningMonster") monster.go.burningmonster:setCausedByChampion(tonumber(self.go.item:getGameEffect())) --optional local output = string.gsub(party.party:getChampionByOrdinal(monster.go.burningmonster:getCausedByChampion()):getName().."\'s "..self.go.item:getUiName().." set the "..monster.go.name.." ablaze.", "%d" , " ") hudPrint(string.gsub(output, "_", " ")) end end, }, { class = "ThrowAttack", attackPower = 9, cooldown = 4, onPostAttack = function(self, champion, slot) self.go.item:setGameEffect(champion:getOrdinal()) end, }, }, tags = { "weapon", "weapon_throwing" }, }
Re: Damage Type on Throwing Weapons
Looking over it again, I spotted a bug [and fixed it]; use the updated definition.
*Before, it could crash if the player picked up the knife and threw it via the mouse.
*Before, it could crash if the player picked up the knife and threw it via the mouse.