Hopefully fix listed_turf shit (Fixes Redmine #150)

This commit is contained in:
Rob Nelson
2014-02-27 13:48:36 -08:00
parent 2d11023852
commit 61cb3adfbe
5 changed files with 54 additions and 21 deletions

View File

@@ -32,6 +32,9 @@
build_click(src, client.buildmode, params, A)
return
if(control_disabled || stat)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
@@ -46,9 +49,15 @@
CtrlClickOn(A)
return
if(control_disabled || stat || world.time <= next_move) return
if(world.time <= next_move)
return
next_move = world.time + 9
if(aicamera.in_camera_mode)
aicamera.camera_mode_off()
aicamera.captureimage(A, usr)
return
/*
AI restrained() currently does nothing
if(restrained())
@@ -113,7 +122,8 @@
Topic("breaker=1", list("breaker"="1"), 0) // 0 meaning no window (consistency! wait...)
/atom/proc/AIAltClick()
/atom/proc/AIAltClick(var/mob/living/silicon/ai/user)
AltClick(user)
return
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.

View File

@@ -7,7 +7,7 @@
/atom/proc/attackby(obj/item/W, mob/user)
return
/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON))
if(W && !(W.flags&NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user)
@@ -20,26 +20,35 @@
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
// Overrides the weapon attack so it can attack any atoms like when we want to have an effect on an object independent of attackby
// It is a powerfull proc but it should be used wisely, if there is other alternatives instead use those
// If it returns 1 it exits click code. Always . = 1 at start of the function if you delete src.
/obj/item/proc/preattack(atom/target, mob/user, proximity_flag, click_parameters)
return
obj/item/proc/get_clamped_volume()
if(src.force && src.w_class)
return Clamp((src.force + src.w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else if(!src.force && src.w_class)
return Clamp(src.w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
var/messagesource = M
//var/messagesource = M
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if (do_surgery(M,user,src))
return
if (istype(M,/mob/living/carbon/brain))
messagesource = M:container
//if (istype(M,/mob/living/carbon/brain))
// messagesource = M:container
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>" )
add_logs(user, M, "attacked", object=src.name, addition="(INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])")
//spawn(1800) // this wont work right
// M.lastattacker = null
@@ -123,15 +132,19 @@
var/showname = "."
if(user)
showname = " by [user]."
showname = " by [user]!"
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null))
if(attack_verb.len)
O.show_message("\red <B>[M] has been [pick(attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(attack_verb && attack_verb.len)
M.visible_message("<span class='danger'>[M] has been [pick(attack_verb)] with [src][showname]</span>",
"<span class='userdanger'>[M] has been [pick(attack_verb)] with [src][showname]!</span>")
else if(force == 0)
M.visible_message("<span class='danger'>[M] has been [pick("tapped","patted")] with [src][showname]</span>",
"<span class='userdanger'>[M] has been [pick("tapped","patted")] with [src][showname]</span>")
else
M.visible_message("<span class='danger'>[M] has been attacked with [src][showname]</span>",
"<span class='userdanger'>[M] has been attacked with [src][showname]</span>")
if(!showname && user)
if(user.client)
@@ -150,7 +163,7 @@
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
if (prob(33) && src.force) // Added blood for whacking non-humans too
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location:add_blood_floor(M)
@@ -160,4 +173,4 @@
M << "Aargh it burns!"
M.updatehealth()
add_fingerprint(user)
return 1
return 1

View File

@@ -23,9 +23,18 @@
next_move = world.time + 8
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"])
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
// You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below
A.attack_ghost(src)