ID:166290
 
to make it so that you can cast spells.
for instance say i have 5 hand symbols(represented by 5 buttons) that a wizard uses in any combination to cast different spells.
i want to have a verb that toggles on and off and changes those 5 buttons to do other actions when the "cast" isn't toggled on.
is that possible, and if so what would i need to look up to get started working on it
Like making combinations using the 5 controls to cast different spells? I think that's possible..
Yes, this is possible. First, you need to override the verbs used by those keys. For example:

client
Northwest()
if(castmode) CastMotion("A")
else ..()
Northeast()
if(castmode) CastMotion("B")
else ..()
Southwest()
if(castmode) CastMotion("C")
else ..()
Southeast()
if(castmode) CastMotion("D")
else ..()

A special verb (maybe with a macro) could turn castmode on and off. Then there's the combo system for spells:
client
var/castdelay=5
var/curcast=""
var/casttime

proc/CastMotion(motion)
curcast += motion
var/m=SpellMatches(curcast)
while(curcast && !m)
var/i
for(i=length(sequence),i>1,--i)
// find the earliest complete spell
m=SpellMatches(copytext(sequence,1,i))
if(m==1) mob.CastSpell(copytext(sequence,1,i))
if(m<=1)
curcast=copytext(curcast,i)
m=SpellMatches(curcast)
break
if(!i)
curcast=copytext(curcast,2)
m=SpellMatches(curcast)
if(curcast && m)
if(m==1)
mob.CastSpell(curcast)
curcast=""
else
casttime = world.time + castdelay
spawn(castdelay) FinishCast()

proc/FinishCast()
if(world.time == casttime)
if(curcast && (curcast in allspells))
mob.CastSpell(curcast)
curcast=""
casttime=0

// 0 = no match
// 1 = exact match
// 2 = 2+ spells or more input needed
proc/SpellMatches(sequence)
.=0
for(var/spell in allspells)
if(!findText(spell,sequence,1,2)) continue
++.
if(spell!=sequence) ++. // not an exact match

Lummox JR