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?
Weapon that heals.
- Zo Kath Ra
- Posts: 944
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Weapon that heals.
Search the asset pack for files that contain the word "boneblade"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?
Re: Weapon that heals.
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" },
}Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Weapon that heals.
Hi Minmay just a question what does the (monster:showDamageText("Backlash", "FF0000") FF0000 mean?
Re: Weapon that heals.
It's the colour of the text in hex R8G8B8 format.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.