TG: Modified TK to be more effective and polished. You can use the TK grab to

interact with machines and stuff from far away (but you cannot pick them up!).
This means you can also bonk people with items you are holding with your TK
grab.

Changed the energy gun sprites to a better-looking version, made by Khodoque!

More work on NTSL. Including the ability to create comments by using // and /*
insert comment here */.

Removed the traffic control machine from telecomms, as requested by Urist. NTSL
is still a work in progress, and needs to be completely fool-proof before
players can get anywhere near it.
Revision: r3252
Author: 	 vageyenaman
This commit is contained in:
Ren Erthilo
2012-04-25 22:22:05 +01:00
parent 91da6814c5
commit 37f4d550a1
8 changed files with 62 additions and 17 deletions

View File

@@ -191,3 +191,11 @@ proc/countJob(rank)
for(var/mob/living/silicon/ai/M in world) for(var/mob/living/silicon/ai/M in world)
if ((M.client && M.machine == subject)) if ((M.client && M.machine == subject))
subject.attack_ai(M) subject.attack_ai(M)
/proc/AutoUpdateTK(obj/subject)
if (subject!=null)
for(var/obj/item/tk_grab/T in world)
if (T.host)
var/mob/M = T.host
if(M.client && M.machine == subject)
subject.attack_hand(M)

View File

@@ -158,8 +158,19 @@ Class Procs:
istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") ) istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
usr << "\red You don't have the dexterity to do this!" usr << "\red You don't have the dexterity to do this!"
return 1 return 1
if ((!in_range(src, usr) || !istype(src.loc, /turf)) && !istype(usr, /mob/living/silicon))
return 1 var/norange = 0
if(istype(usr, /mob/living/carbon/human))
var/mob/living/carbon/human/H = usr
if(istype(H.l_hand, /obj/item/tk_grab))
norange = 1
else if(istype(H.r_hand, /obj/item/tk_grab))
norange = 1
if(!norange)
if ((!in_range(src, usr) || !istype(src.loc, /turf)) && !istype(usr, /mob/living/silicon))
return 1
src.add_fingerprint(usr) src.add_fingerprint(usr)
return 0 return 0
@@ -174,9 +185,9 @@ Class Procs:
return 1 return 1
if(user.lying || user.stat) if(user.lying || user.stat)
return 1 return 1
if ( ! (istype(user, /mob/living/carbon/human) || \ if ( ! (istype(usr, /mob/living/carbon/human) || \
istype(user, /mob/living/silicon) || \ istype(usr, /mob/living/silicon) || \
istype(user, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") ) istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
usr << "\red You don't have the dexterity to do this!" usr << "\red You don't have the dexterity to do this!"
return 1 return 1
/* /*

View File

@@ -376,9 +376,18 @@ mob/proc/flash_weak_pain()
step_away(Metroid, user) step_away(Metroid, user)
Metroid.canmove = 1 Metroid.canmove = 1
var/showname = "."
if(user)
showname = " by [user]."
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null)) for(var/mob/O in viewers(messagesource, null))
O.show_message(text("\red <B>[] has been attacked with [][] </B>", M, src, (user ? text(" by [].", user) : ".")), 1) O.show_message(text("\red <B>[] has been attacked with [][] </B>", M, src, showname), 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"

View File

@@ -43,7 +43,7 @@
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this
if(!target || !user) return if(!target || !user) return
if(last_throw+4 > world.time) return if(last_throw+3 > world.time) return
if(!host) if(!host)
del(src) del(src)
return return
@@ -51,19 +51,24 @@
del(src) del(src)
return return
if(!focus) if(!focus)
focus_object(target) focus_object(target, user)
return return
var/focusturf = get_turf(focus)
if(get_dist(focusturf, target) <= 1 && !istype(target, /turf))
target.attackby(focus, user, user:get_organ_target())
if((get_dist(target, user) <= 16) && (get_dist(focus, user) <= 10)) else if(get_dist(focusturf, target) <= 16)
apply_focus_overlay() apply_focus_overlay()
focus.throw_at(target, 10, 1) focus.throw_at(target, 10, 1)
last_throw = world.time last_throw = world.time
return return
proc/focus_object(var/obj/target) proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored) return//No throwing anchored things if(target.anchored)
target.attack_hand(user) // you can use shit now!
return//No throwing anchored things
focus = target focus = target
update_icon() update_icon()
apply_focus_overlay() apply_focus_overlay()

View File

@@ -8,12 +8,21 @@
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh. if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
src.attack_ai(usr) src.attack_ai(usr)
// check for TK users
AutoUpdateTK(src)
if (istype(usr, /mob/living/carbon/human))
if(istype(usr.l_hand, /obj/item/tk_grab) || istype(usr.r_hand, /obj/item/tk_grab/))
if(!(usr in nearby))
if(usr.client && usr.machine==src)
src.attack_hand(usr)
/obj/proc/updateDialog() /obj/proc/updateDialog()
var/list/nearby = viewers(1, src) var/list/nearby = viewers(1, src)
for(var/mob/M in nearby) for(var/mob/M in nearby)
if ((M.client && M.machine == src)) if ((M.client && M.machine == src))
src.attack_hand(M) src.attack_hand(M)
AutoUpdateAI(src) AutoUpdateAI(src)
//AutoUpdateTK(src)
/obj/proc/update_icon() /obj/proc/update_icon()
return return

View File

@@ -174,7 +174,7 @@
bmark.pixel_x-- bmark.pixel_x--
bmark.pixel_y-- bmark.pixel_y--
if(Proj.damage >= 20) if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/practice))
bmark.icon_state = "scorch" bmark.icon_state = "scorch"
bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design

View File

@@ -213,7 +213,7 @@ proc/check_panel(mob/M)
if (istype(M, /mob/living/carbon/human) || istype(M, /mob/living/silicon/ai)) if (istype(M, /mob/living/carbon/human) || istype(M, /mob/living/silicon/ai))
if(M.hallucination < 15) if(M.hallucination < 15)
return 1 return 1
return 0 */ return 0*/
/obj/fake_attacker /obj/fake_attacker
icon = null icon = null

View File

@@ -1,12 +1,13 @@
/obj/item/weapon/gun/energy/gun /obj/item/weapon/gun/energy/gun
icon_state = "energy" icon_state = "energystun100"
name = "\improper Energy Gun" name = "energy gun"
desc = "A basic energy-based gun with two settings: Stun and kill." desc = "A basic energy-based gun with two settings: Stun and kill."
fire_sound = 'Taser.ogg' fire_sound = 'Taser.ogg'
charge_cost = 100 //How much energy is needed to fire. charge_cost = 100 //How much energy is needed to fire.
projectile_type = "/obj/item/projectile/energy/electrode" projectile_type = "/obj/item/projectile/energy/electrode"
origin_tech = "combat=3;magnets=2" origin_tech = "combat=3;magnets=2"
modifystate = "energystun"
var var
mode = 0 //0 = stun, 1 = kill mode = 0 //0 = stun, 1 = kill
@@ -19,14 +20,16 @@
mode = 1 mode = 1
charge_cost = 100 charge_cost = 100
fire_sound = 'Laser.ogg' fire_sound = 'Laser.ogg'
user << "\red [src] is now set to kill." user << "\red [src.name] is now set to kill."
projectile_type = "/obj/item/projectile/beam" projectile_type = "/obj/item/projectile/beam"
modifystate = "energykill"
if(1) if(1)
mode = 0 mode = 0
charge_cost = 100 charge_cost = 100
fire_sound = 'Taser.ogg' fire_sound = 'Taser.ogg'
user << "\red [src] is now set to stun." user << "\red [src.name] is now set to stun."
projectile_type = "/obj/item/projectile/energy/electrode" projectile_type = "/obj/item/projectile/energy/electrode"
modifystate = "energystun"
update_icon() update_icon()
return return