Page 1 of 1
Damage Type on Throwing Weapons
Posted: Wed Nov 25, 2015 12:15 am
by mythos
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.
Re: Damage Type on Throwing Weapons
Posted: Wed Nov 25, 2015 11:00 pm
by Zo Kath Ra
mythos 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.
The only solution I can think of is to use
ItemComponent.onThrowAttackHitMonster(self, monster)
and then spawning a TileDamager on the monster's location.
Re: Damage Type on Throwing Weapons
Posted: Thu Nov 26, 2015 12:05 am
by mythos
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!
Re: Damage Type on Throwing Weapons
Posted: Thu Nov 26, 2015 12:16 am
by Isaac
Zo Kath Ra wrote:and then spawning a TileDamager on the monster's location.
But (as we know) tile damager would burn the whole troop, not just the target; in cases of grouped attackers.
*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" },
}
Re: Damage Type on Throwing Weapons
Posted: Thu Nov 26, 2015 7:28 am
by mythos
Isaac wrote:Zo Kath Ra wrote:and then spawning a TileDamager on the monster's location.
But (as we know) tile damager would burn the whole troop, not just the target; in cases of grouped attackers.
*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")
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" },
}
Perfect! You rock. I can always make it an end game item or something. I just wanted to do something unique with throwing weapons.
Re: Damage Type on Throwing Weapons
Posted: Thu Nov 26, 2015 10:36 am
by Isaac
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.