Files
CHOMPStation2/interface/interface.dm
elly1989@rocketmail.com b903680fbd Changed client/verb/a_intent_change() to mob/verb/a_intent_change()
Replaced usr references with mob
This means it can be called as a proc for any mob to use that code. Updated the click-procs to use this as they were using slightly different code.
Fixed an issue with AIs using the intent hotkeys
Added more sanity checks to it.
Insert key uses the same code as other hotkeys.
Commented out some unused hud-code from when we had separate intent buttons.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4766 316c924e-a436-60f5-8080-3fe189b3f50e
2012-09-28 06:45:57 +00:00

143 lines
3.6 KiB
Plaintext

//Please use mob or src (not usr) in these procs. This way they can be called in the same fashion as procs.
/client/verb/wiki()
set name = "wiki"
set desc = "Visit the wiki."
set hidden = 1
if( config.wikiurl )
if(alert("This will open the wiki in your browser. Are you sure?",,"Yes","No")=="No")
return
src << link(config.wikiurl)
else
src << "\red The wiki URL is not set in the server configuration."
return
/client/verb/forum()
set name = "forum"
set desc = "Visit the forum."
set hidden = 1
if( config.forumurl )
if(alert("This will open the forum in your browser. Are you sure?",,"Yes","No")=="No")
return
src << link(config.forumurl)
else
src << "\red The forum URL is not set in the server configuration."
return
#define RULES_FILE "config/rules.html"
/client/verb/rules()
set name = "Rules"
set desc = "Show Server Rules."
set hidden = 1
src << browse(file(RULES_FILE), "window=rules;size=480x320")
#undef RULES_FILE
//converts intent-strings into numbers and back
var/list/intents = list("help","disarm","grab","hurt")
/proc/intent_numeric(argument)
if(istext(argument))
switch(argument)
if("help") return 0
if("disarm") return 1
if("grab") return 2
else return 3
else
switch(argument)
if(0) return "help"
if(1) return "disarm"
if(2) return "grab"
else return "hurt"
//change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left
/mob/verb/a_intent_change(input as text)
set name = "a-intent"
set hidden = 1
if(ishuman(src) || istype(src,/mob/living/carbon/alien/humanoid))
switch(input)
if("help","disarm","grab","hurt")
a_intent = input
if("right")
a_intent = intent_numeric((intent_numeric(a_intent)+1) % 4)
if("left")
a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4)
if(hud_used && hud_used.action_intent)
hud_used.action_intent.icon_state = "intent_[a_intent]"
else if(isrobot(src) || ismonkey(src) || islarva(src))
switch(input)
if("help")
a_intent = "help"
if("hurt")
a_intent = "hurt"
if("right","left")
a_intent = intent_numeric(intent_numeric(a_intent) - 3)
if(hud_used && hud_used.action_intent)
if(a_intent == "hurt")
hud_used.action_intent.icon_state = "harm"
else
hud_used.action_intent.icon_state = "help"
/client/verb/hotkeys_help()
set name = "hotkeys-help"
set category = "OOC"
var/hotkey_mode = {"<font color='purple'>
Hotkey-Mode: (hotkey-mode must be on)
\tTAB = toggle hotkey-mode
\ta = left
\ts = down
\td = right
\tw = up
\tq = drop
\te = equip
\tr = throw
\tt = say
\tx = swap-hand
\tz = activate held object (or y)
\tf = cycle-intents-left
\tg = cycle-intents-right
\t1 = help-intent
\t2 = disarm-intent
\t3 = grab-intent
\t4 = harm-intent
</font>"}
var/other = {"<font color='purple'>
Any-Mode: (hotkey doesn't need to be on)
\tCtrl+a = left
\tCtrl+s = down
\tCtrl+d = right
\tCtrl+w = up
\tCtrl+q = drop
\tCtrl+e = equip
\tCtrl+r = throw
\tCtrl+x = swap-hand
\tCtrl+z = activate held object (or Ctrl+y)
\tCtrl+f = cycle-intents-left
\tCtrl+g = cycle-intents-right
\tCtrl+1 = help-intent
\tCtrl+2 = disarm-intent
\tCtrl+3 = grab-intent
\tCtrl+4 = harm-intent
\tDEL = pull
\tINS = cycle-intents-right
\tHOME = drop
\tPGUP = swap-hand
\tPGDN = activate held object
\tEND = throw
</font>"}
var/admin = {"<font color='purple'>
Admin:
\tF5 = Aghost (admin-ghost)
\tF6 = player-panel-new
\tF7 = admin-pm
\tF8 = Invisimin
</font>"}
src << hotkey_mode
src << other
if(holder)
src << admin