Page 1 of 1

Weapon that heals.

Posted: Mon Mar 16, 2015 1:52 am
by Emera Nova
I'd like to make a weapon that either gives a % of your hit back as health for the user of the weapon or make it so it has (x) amount of charges to heal either (x) amount of heal or heal a % of its next hit.

Ideas?

Re: Weapon that heals.

Posted: Mon Mar 16, 2015 2:00 am
by Zo Kath Ra
Emera Nova wrote:I'd like to make a weapon that either gives a % of your hit back as health for the user of the weapon or make it so it has (x) amount of charges to heal either (x) amount of heal or heal a % of its next hit.

Ideas?
Search the asset pack for files that contain the word "boneblade"

Re: Weapon that heals.

Posted: Mon Mar 16, 2015 2:38 am
by minmay

Code: Select all

defineObject{
	name = "backbiter",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/backbiter.fbx",
		},
		{
			class = "Item",
			uiName = "Backbiter",
			description = "A vicious little blade tainted by unholy rites.",
			gfxIndex = 228,
			gfxIndexPowerAttack = 202,
			impactSound = "impact_blade",
			weight = 2.4,
			secondaryAction = "leech",
			traits = { "light_weapon", "dagger" },
		},
		{
			class = "MeleeAttack",
			attackPower = 10,
			accuracy = 5,
			cooldown = 3,
			swipe = "vertical",
			attackSound = "swipe_light",
		},
		{
			class = "MeleeAttack",
			name = "leech",
			uiName = "Leech",
			attackPower = 20,
			accuracy = 20,
			cooldown = 4.5,
			energyCost = 25,
			swipe = "vertical",
			attackSound = "swipe_light",
			requirements = { "light_weapons", 3 },
			onHitMonster = function(self, monster, side, dmg, champion)
				if monster:hasTrait("undead") then
					-- draining undeads is not wise
					monster:showDamageText("Backlash", "FF0000")
					champion:damage(dmg*0.7, "physical")
					return false
				elseif monster:hasTrait("elemental") or monster:hasTrait("construct") then
					-- elementals are constructs are immune to leech
					monster:showDamageText("Immune")
					return false
				else
					champion:regainHealth(dmg*0.7)
				end
			end,
			gameEffect = "Successful hit drains life from target and heals you.",
		},
	},
	tags = { "weapon" },
}

Re: Weapon that heals.

Posted: Mon Mar 16, 2015 6:27 am
by Eleven Warrior
Hi Minmay just a question what does the (monster:showDamageText("Backlash", "FF0000") FF0000 mean?

Re: Weapon that heals.

Posted: Mon Mar 16, 2015 6:42 am
by minmay
It's the colour of the text in hex R8G8B8 format.