Reworked the gun system to handle hostage scenarios better.

Ported and adjusted with permission from Lost Worlds.
This commit is contained in:
SkyMarshal
2012-03-01 19:20:39 -07:00
parent 8a96288384
commit 0d8c7d5e51
53 changed files with 1938 additions and 139 deletions
@@ -444,6 +444,13 @@
AddCamoOverlay(loc)//Overlay camo.
else
invisibility = 0
if(targeted_by && target_locked)
overlays += target_locked
else if(targeted_by)
target_locked = new /obj/effect/target_locked(src)
overlays += target_locked
else if(!targeted_by && target_locked)
del(target_locked)
for (var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
@@ -1173,6 +1173,13 @@
invisibility = 2
else
invisibility = 0
if(targeted_by && target_locked)
overlays += target_locked
else if(targeted_by)
target_locked = new /obj/effect/target_locked(src)
overlays += target_locked
else if(!targeted_by && target_locked)
del(target_locked)
/*
for (var/mob/M in viewers(1, src))//For the love of god DO NOT REFRESH EVERY SECOND - Mport
@@ -439,8 +439,7 @@
if(update_icon) // Skie
..()
for(var/i in overlays)
overlays -= i
overlays = null
if (!( lying ))
icon_state = "monkey1"
@@ -505,6 +504,13 @@
else
m_select.screen_loc = null
if(targeted_by && target_locked)
overlays += target_locked
else if(targeted_by)
target_locked = new /obj/effect/target_locked(src)
overlays += target_locked
else if(!targeted_by && target_locked)
del(target_locked)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
spawn( 0 )
+2 -2
View File
@@ -42,9 +42,9 @@
if(!effect || (blocked >= 2)) return 0
switch(effecttype)
if(STUN)
Stun((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
Stun((effect - (effect*getarmor(null, "laser"))))
if(WEAKEN)
Weaken((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
Weaken((effect - (effect*getarmor(null, "laser"))))
if(PARALYZE)
Paralyse(effect/(blocked+1))
if(IRRADIATE)
+33 -16
View File
@@ -86,22 +86,39 @@
var/channel_prefix = copytext(message, 1, 3)
var/list/keys = list(
":r" = "right ear",
":l" = "left ear",
":i" = "intercom",
":h" = "department",
":c" = "Command",
":n" = "Science",
":m" = "Medical",
":e" = "Engineering",
":s" = "Security",
":w" = "whisper",
":b" = "binary",
":a" = "alientalk",
":t" = "Syndicate",
":d" = "Mining",
":q" = "Cargo",
":g" = "changeling",
":r" = "right ear",
":l" = "left ear",
":i" = "intercom",
":h" = "department",
":c" = "Command",
":n" = "Science",
":m" = "Medical",
":e" = "Engineering",
":s" = "Security",
":w" = "whisper",
":b" = "binary",
":a" = "alientalk",
":t" = "Syndicate",
":d" = "Mining",
":q" = "Cargo",
":g" = "changeling",
":R" = "right hand",
":L" = "left hand",
":I" = "intercom",
":H" = "department",
":C" = "Command",
":N" = "Science",
":M" = "Medical",
":E" = "Engineering",
":S" = "Security",
":W" = "whisper",
":B" = "binary",
":A" = "alientalk",
":T" = "Syndicate",
":D" = "Mining",
":Q" = "Cargo",
":G" = "changeling",
//kinda localization -- rastaf0
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
@@ -700,6 +700,14 @@
overlays += "ov-openpanel +c"
else
overlays += "ov-openpanel -c"
if(targeted_by && target_locked)
overlays += target_locked
else if(targeted_by)
target_locked = new /obj/effect/target_locked(src)
overlays += target_locked
else if(!targeted_by && target_locked)
del(target_locked)
return
+2 -2
View File
@@ -15,13 +15,13 @@
return
if (length(message) >= 2)
if (copytext(message, 1, 3) == ":s")
if ((copytext(message, 1, 3) == ":s") || (copytext(message, 1, 3) == ":S"))
if(istype(src, /mob/living/silicon/pai))
return ..(message)
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
robot_talk(message)
else if (copytext(message, 1, 3) == ":h")
else if ((copytext(message, 1, 3) == ":h") || (copytext(message, 1, 3) == ":H"))
if(isAI(src)&&client)//For patching directly into AI holopads.
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
+1
View File
@@ -173,6 +173,7 @@
return 0
move_delay = world.time//set move delay
mob.last_move_intent = world.time + 10
switch(mob.m_intent)
if("run")
if(mob.drowsyness > 0)
+50
View File
@@ -25,6 +25,25 @@
var/selecting = "chest"
screen_loc = "EAST+1,NORTH"
/obj/screen/gun
name = "gun"
icon = 'screen1.dmi'
master = null
move
name = "Allow Walking"
icon_state = "no_walk"
screen_loc = ui_gun2
run
name = "Allow Running"
icon_state = "no_run"
screen_loc = ui_gun3
item
name = "Allow Item Use"
icon_state = "no_item"
screen_loc = ui_gun1
/obj/screen/zone_sel/MouseDown(location, control,params)
// Changes because of 4.0
@@ -569,6 +588,37 @@
usr:inv3.icon_state = "inv3"
usr:module_active = null
if("Allow Walking")
usr.AllowTargetMove()
icon_state = "walking"
name = "Disallow Walking"
if("Disallow Walking")
usr.AllowTargetMove()
icon_state = "no_walk"
name = "Allow Walking"
if("Allow Running")
usr.AllowTargetRun()
icon_state = "running"
name = "Disallow Running"
if("Disallow Running")
usr.AllowTargetRun()
icon_state = "no_run"
name = "Allow Running"
if("Allow Item Use")
name = "Disallow Item Use"
icon_state = "act_throw_off"
usr.AllowTargetClick()
if("Disallow Item Use")
name = "Allow Item Use"
icon_state = "no_item"
usr.AllowTargetClick()
else
DblClick()
return