Thanks for the hammer, looks great & fits right in. We need more higher level weapons. I remember playing that arcade game too!
edit: it looks awesome when you throw it, speed is right too.
Now someone just needs to figure out how to get the thrown hammer back in the player's hand when it stops moving (hit or miss) so they can make weapons that return. Make a thrower that much more useful without weighing them down with a ton of hammers, lol. (and it lets you make your Wulfgar clones and whatnot)Batty wrote:Thanks for the hammer, looks great & fits right in. We need more higher level weapons. I remember playing that arcade game too!
edit: it looks awesome when you throw it, speed is right too.
I agree the hammer looks very cool.Batty wrote:Thanks for the hammer, looks great & fits right in. We need more higher level weapons. I remember playing that arcade game too!
edit: it looks awesome when you throw it, speed is right too.
Might be possible by checking the party onAttack hook... e.g. if weapon.name = "throwing_hammer"... spawn a timer to add a slight delay (could even adjust delay for distance between party and monster) then destroy the original hammer and spawn a new one that flies back at the party... finally destroy the returning hammer and spawn one in the characters hand and destroy the timer.Szragodesca wrote: Now someone just needs to figure out how to get the thrown hammer back in the player's hand when it stops moving (hit or miss) so they can make weapons that return. Make a thrower that much more useful without weighing them down with a ton of hammers, lol. (and it lets you make your Wulfgar clones and whatnot)
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onAttack = function(champion,weapon)
return party_script.weaponCheck(champion,weapon)
end,
}
Code: Select all
local monstersList = {
"crab","crowern","cube","goromorg","green_slime","herder","herder_big","herder_small","herder_swarm","ice_lizard","ogre","scavenger","scavenger_swarm","shrakk_torr","skeleton_archer","skeleton_archer_patrol","skeleton_patrol","skeleton_warrior","snail","spider","tentacles","uggardian","warden","wyvern"
}
for i=1,# monstersList do
cloneObject{
name = monstersList[i],
baseObject = monstersList[i],
onProjectileHit = function(monster, weapon)
return party_script.projectileCheck(monster,weapon)
end,
}
end
Code: Select all
cloneObject{
name ="returning_throwing_axe",
baseObject="throwing_axe",
uiName = "Throwing Axe of Returning",
sharpProjectile = false,
stackable = false,
}
Code: Select all
function weaponCheck(champion,weapon)
if weapon ~= nil
then
if weapon.name == "returning_throwing_axe" then
thrower = champion
-- hudPrint(thrower:getName())
end
end
end
function projectileCheck(monster,weapon)
if weapon.name == "returning_throwing_axe" then
-- hudPrint("Returning Throwing Axe with ID " .. weapon.id)
if findEntity(weapon.id) ~= nil then
-- hudPrint(thrower:getName())
weapon:destroy()
if thrower:getItem(7) == nil then
thrower:insertItem(7,spawn("returning_throwing_axe"))
elseif thrower:getItem(8) == nil then
thrower:insertItem(8,spawn("returning_throwing_axe"))
end
end
end
end
Code: Select all
-- get distance between party and monster
function getDistance(obj1,obj2)
local distance = 0
local XNumber = math.max(obj1.x,obj2.x) - math.min(obj1.x,obj2.x)
local YNumber = math.max(obj1.y,obj2.y) - math.min(obj1.y,obj2.y)
distance = XNumber + YNumber
return distance
end
-- party onAttack
thrower = party:getChampion(1) -- this sets champion 1 as the initial thrower.. purely for the case that you first throw the axe from the mousepointer!
function weaponCheck(champion,weapon)
if weapon ~= nil
then
if weapon.name == "returning_throwing_axe" then
thrower = champion
-- hudPrint(thrower:getName())
else
-- hudPrint("Other Weapon")
end
else
-- hudPrint("Unarmed")
end
end
-- Monster onProjectile Hit
function projectileCheck(monster,weapon)
if weapon.name == "returning_throwing_axe" then
-- hudPrint("Returning Throwing Axe with ID " .. weapon.id)
if findEntity(weapon.id) ~= nil then
-- hudPrint(thrower:getName())
weapon:destroy()
local distance = getDistance(party,monster)
local facing = (party.facing + 2)%4
local dx,dy = getForward(facing)
shootProjectile("returning_throwing_axe", party.level, monster.x+dx, monster.y+dy, facing, 2*distance, 1, 1, 0, 0, 0, 0, false, true)
if thrower:getItem(7) == nil then
thrower:insertItem(7,spawn("returning_throwing_axe"))
elseif thrower:getItem(8) == nil then
thrower:insertItem(8,spawn("returning_throwing_axe"))
else
spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
end
end
end
end
I don't recall which game it was, but there was a Dungeon Master-ish D&D game where you could cast Spiritual Hammer and either attack with it in melee, or right-click it and have it thrown. Maybe Dungeon Hack. . . I played that one a lot back in the day. Would be a good way to utilize the Spiritual Hammer idea, no? Attack with left click, throw with right click?JohnWordsworth wrote:If only we had the power to add enemy AI, I could picture a spiritual hammer spell, which would essentially summon a monster on your side that would just be a glowing, floating, attacking hammer. I guess the bad guys could still have it. Ahhh, D&D.