Page 1 of 1
Dragon Breath Rev
Posted: Sat Mar 21, 2015 6:33 pm
by Emera Nova
So I'm trying to figure out a way to make the dragons breath rev have the ability to shoot out a ball of fire that could either feed off the energy that you have or be stored up in charges on the weapon. Problem is that gun has to have its reload secondary action otherwise the gun won't fire.
How do I go about putting in this code into the gun so that it works along side the reload action?
Code: Select all
{
class = "CastSpell",
name = "fireball",
uiName = "Fireball",
cooldown = 5,
spell = "fireball",
energyCost = 25,
power = 4,
charges = 9,
fullGfxIndex = 215,
emptyGfxIndex = 216,
requirements = { "concentration", 1 },
},
Re: Dragon Breath Rev
Posted: Sat Mar 21, 2015 8:08 pm
by minmay
Easy option: use ItemComponent:setSecondaryAction() to allow the fireball when the gun is fully reloaded, and Reload otherwise.
Slightly harder option: Come up with an interface for selecting from more than 2 item actions. Now that there is a PartyComponent.onDrawAttackPanel hook it should be easy to implement something like
this.
Re: Dragon Breath Rev
Posted: Sat Mar 21, 2015 8:41 pm
by Emera Nova
Do I use "ItemComponent:setSecondaryAction()" inside the script for the gun somewhere or in the dungeon as a script somewhere?
Code: Select all
defineObject{
name = "revolver",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/revolver.fbx",
},
{
class = "Item",
uiName = "Dragonbreath Revolver",
description = "Powerful runes and enchantments are inscribed upon this weapon to keep its intricate mechanisms working.",
gfxIndex = 332,
gfxIndexPowerAttack = 417,
impactSound = "impact_blunt",
secondaryAction = "reload",
weight = 1.5,
traits = { "firearm" },
},
{
class = "FirearmAttack",
attackPower = 22,
cooldown = 1.5,
attackSound = "gun_shot_small",
ammo = "pellet",
clipSize = 6,
jamChance = 12,
requirements = { "firearms", 3 },
},
{
class = "ReloadFirearm",
uiName = "Reload",
name = "reload",
requirements = { "firearms", 3 },
gameEffect = "Reloads all six chambers of the revolver."
},
{
class = "CastSpell",
name = "fireball",
uiName = "Fireball",
cooldown = 5,
spell = "fireball",
energyCost = 25,
power = 4,
charges = 9,
fullGfxIndex = 215,
emptyGfxIndex = 216,
requirements = { "concentration", 1 },
},
},
}
Thats what I have down at the moment my guess is its loaded with errors xD..
Re: Dragon Breath Rev
Posted: Sat Mar 21, 2015 10:39 pm
by minmay
Emera Nova wrote:Do I use "ItemComponent:setSecondaryAction()" inside the script for the gun somewhere or in the dungeon as a script somewhere?
For the behaviour I described you would set the secondary action to fireball when reload is used and set the secondary action to reload when firearmattack is used.
Re: Dragon Breath Rev
Posted: Sat Mar 21, 2015 11:15 pm
by Emera Nova

how do you do that
