Chameleon Jumpsuit now has armor, space tiles now get generated faster, fixed fingerprint runtime, optimized autosay, fixed crates + package wrappers, retired admins are no longer spammed, can now click through blindness, packages and evidence bag contents now count toward traitor objectives, stunning and such stops you instantly, guncode improvements.

This commit is contained in:
SkyMarshal
2012-03-24 16:42:44 -07:00
parent c0bc942d34
commit f45aff1bae
30 changed files with 285 additions and 224 deletions

View File

@@ -29,6 +29,7 @@
desc = "A plain jumpsuit. It seems to have a small dial on the wrist." desc = "A plain jumpsuit. It seems to have a small dial on the wrist."
origin_tech = "syndicate=3" origin_tech = "syndicate=3"
var/list/clothing_choices = list() var/list/clothing_choices = list()
armor = list(melee = 10, bullet = 0, laser = 50,energy = 0, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/under/chameleon/psyche /obj/item/clothing/under/chameleon/psyche
item_state = "bl_suit" item_state = "bl_suit"

View File

@@ -47,7 +47,7 @@
/turf/space/New() /turf/space/New()
// icon = 'space.dmi' // icon = 'space.dmi'
..() ..()
icon_state = "[pick(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)]" icon_state = "[rand(1,25)]"
/turf/simulated /turf/simulated
name = "station" name = "station"

View File

@@ -126,7 +126,7 @@
if(src.fingerprints.len == 1) if(src.fingerprints.len == 1)
src.fingerprints = list() src.fingerprints = list()
else else
for(var/j = i, j <= (src.fingerprints.len), j++) for(var/j = i, j < (src.fingerprints.len), j++)
src.fingerprints[j] = src.fingerprints[j+1] src.fingerprints[j] = src.fingerprints[j+1]
src.fingerprints.len-- src.fingerprints.len--
else else

View File

@@ -15,12 +15,6 @@
/datum/game_mode/traitor/autotraitor/pre_setup() /datum/game_mode/traitor/autotraitor/pre_setup()
possible_traitors = get_players_for_role(BE_TRAITOR) possible_traitors = get_players_for_role(BE_TRAITOR)
for(var/datum/mind/player in possible_traitors)
for(var/job in restricted_jobs)
if(player.assigned_role == job)
possible_traitors -= player
for(var/mob/new_player/P in world) for(var/mob/new_player/P in world)
if(P.client && P.ready) if(P.client && P.ready)
num_players++ num_players++
@@ -84,11 +78,6 @@
traitorcount += 1 traitorcount += 1
if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate"))
possible_traitors += player possible_traitors += player
for(var/datum/mind/player in possible_traitors)
for(var/job in restricted_jobs)
if(player.assigned_role == job)
possible_traitors -= player
//message_admins("Live Players: [playercount]") //message_admins("Live Players: [playercount]")
//message_admins("Live Traitors: [traitorcount]") //message_admins("Live Traitors: [traitorcount]")
// message_admins("Potential Traitors:") // message_admins("Potential Traitors:")

View File

@@ -39,7 +39,7 @@ Stealthy and Inconspicuous Weapons;
/obj/item/weapon/cartridge/syndicate:3:Detomatix PDA Cartridge; /obj/item/weapon/cartridge/syndicate:3:Detomatix PDA Cartridge;
Whitespace:Seperator; Whitespace:Seperator;
Stealth and Camouflage Items; Stealth and Camouflage Items;
/obj/item/clothing/under/chameleon:3:Chameleon Jumpsuit; /obj/item/clothing/under/chameleon:4:Chameleon Jumpsuit, with armor.;
/obj/item/clothing/shoes/syndigaloshes:2:No-Slip Syndicate Shoes; /obj/item/clothing/shoes/syndigaloshes:2:No-Slip Syndicate Shoes;
/obj/item/weapon/card/id/syndicate:3:Agent ID card; /obj/item/weapon/card/id/syndicate:3:Agent ID card;
/obj/item/clothing/mask/gas/voice:4:Voice Changer; /obj/item/clothing/mask/gas/voice:4:Voice Changer;

View File

@@ -114,10 +114,10 @@ THERMAL GLASSES
var/obj/item/clothing/under/V = new U var/obj/item/clothing/under/V = new U
src.clothing_choices += V src.clothing_choices += V
for(var/U in typesof(/obj/item/clothing/under/rank)-(/obj/item/clothing/under/rank)) // for(var/U in typesof(/obj/item/clothing/under/rank)-(/obj/item/clothing/under/rank))
var/obj/item/clothing/under/V = new U // var/obj/item/clothing/under/V = new U
src.clothing_choices += V // src.clothing_choices += V
return return
@@ -163,7 +163,7 @@ THERMAL GLASSES
var/obj/item/clothing/under/A var/obj/item/clothing/under/A
A = input("Select Colour to change it to", "BOOYEA", A) in clothing_choices A = input("Select Colour to change it to", "BOOYEA", A) in clothing_choices|null
if(!A) if(!A)
return return

View File

@@ -243,107 +243,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (!connection) if (!connection)
return return
if(subspace_transmission)
// First, we want to generate a new radio signal
var/datum/signal/signal = new
signal.transmission_method = 2 // 2 would be a subspace transmission.
// transmission_method could probably be enumerated through #define. Would be neater.
// --- Finally, tag the actual signal with the appropriate values ---
signal.data = list(
// Identity-associated tags:
"mob" = new /mob/living/silicon/ai(src), // store a reference to the mob
"mobtype" = /mob/living/silicon/ai, // the mob's type
"realname" = from, // the mob's real name
"name" = from, // the mob's display name
"job" = "Automated Announcement", // the mob's job
"key" = "none", // the mob's key
"vmessage" = "*garbled automated announcement*", // the message to display if the voice wasn't understood
"vname" = "synthesized voice", // the name to display if the voice wasn't understood
"vmask" = 0, // 1 if the mob is using a voice gas mask
// We store things that would otherwise be kept in the actual mob
// so that they can be logged even AFTER the mob is deleted or something
// Other tags:
"compression" = rand(45,50), // compressed radio signal
"message" = message, // the actual sent message
"connection" = connection, // the radio connection to use
"radio" = src, // stores the radio used for transmission
"slow" = 0, // how much to sleep() before broadcasting - simulates net lag
"traffic" = 0, // dictates the total traffic sum that the signal went through
"type" = 0, // determines what type of radio input it is: normal broadcast
"server" = null, // the last server to log this signal
"reject" = 0 // if nonzero, the signal will not be accepted by any broadcasting machinery
)
signal.frequency = connection.frequency // Quick frequency set
//#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in world)
R.receive_signal(signal)
// Allinone can act as receivers.
for(var/obj/machinery/telecomms/allinone/R in world)
R.receive_signal(signal)
// Receiving code can be located in Telecommunications.dm
return
/* ###### Intercoms and station-bounced radios ###### */
var/filter_type = 2
var/datum/signal/signal = new
signal.transmission_method = 2
/* --- Try to send a normal subspace broadcast first */
signal.data = list(
"mob" = new /mob/living/silicon/ai(src), // store a reference to the mob
"mobtype" = /mob/living/silicon/ai, // the mob's type
"realname" = from, // the mob's real name
"name" = from, // the mob's display name
"job" = "Automated Announcement", // the mob's job
"key" = "none", // the mob's key
"vmessage" = "*garbled automated announcement*", // the message to display if the voice wasn't understood
"vname" = "synthesized voice", // the name to display if the voice wasn't understood
"vmask" = 0, // 1 if the mob is using a voice gas mask
// We store things that would otherwise be kept in the actual mob
// so that they can be logged even AFTER the mob is deleted or something
// Other tags:
"compression" = 0, // compressed radio signal
"message" = message, // the actual sent message
"connection" = connection, // the radio connection to use
"radio" = src, // stores the radio used for transmission
"slow" = 0, // how much to sleep() before broadcasting - simulates net lag
"traffic" = 0, // dictates the total traffic sum that the signal went through
"type" = 0, // determines what type of radio input it is: normal broadcast
"server" = null, // the last server to log this signal
"reject" = 0 // if nonzero, the signal will not be accepted by any broadcasting machinery
)
signal.frequency = connection.frequency // Quick frequency set
for(var/obj/machinery/telecomms/receiver/R in world)
R.receive_signal(signal)
sleep(rand(10,25)) // wait a little...
if(signal.data["done"])
del(signal) // delete the signal - we're done here.
return
// Oh my god; the comms are down or something because the signal hasn't been broadcasted yet.
// Send a mundane broadcast with limited targets:
Broadcast_Message(connection, new /mob/living/silicon/ai(src), 0, "*garbled automated announcement*", Broadcast_Message(connection, new /mob/living/silicon/ai(src), 0, "*garbled automated announcement*",
src, message, from, "Automated Announcement", from, "synthesized voice", src, message, from, "Automated Announcement", from, "synthesized voice", 4, 0)
filter_type, signal.data["compression"])
return return
/obj/item/device/radio/talk_into(mob/M as mob, message, channel) /obj/item/device/radio/talk_into(mob/M as mob, message, channel)

View File

@@ -286,6 +286,8 @@
user.drop_item() user.drop_item()
if(W) if(W)
W.loc = src.loc W.loc = src.loc
else if(istype(W,/obj/item/weapon/packageWrap))
return
else return attack_hand(user) else return attack_hand(user)
/obj/structure/closet/crate/secure/emp_act(severity) /obj/structure/closet/crate/secure/emp_act(severity)

View File

@@ -3,7 +3,7 @@
/proc/message_admins(var/text, var/admin_ref = 0) /proc/message_admins(var/text, var/admin_ref = 0)
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[text]</span></span>" var/rendered = "<span class=\"admin\"><span class=\"prefix\">ADMIN LOG:</span> <span class=\"message\">[text]</span></span>"
for (var/mob/M in world) for (var/mob/M in world)
if (M && M.client && M.client.holder) if (M && M.client && M.client.holder && M.client.holder.level > -3) //Lets not spam our retirees.
if (admin_ref) if (admin_ref)
M << dd_replaceText(rendered, "%admin_ref%", "\ref[M]") M << dd_replaceText(rendered, "%admin_ref%", "\ref[M]")
else else

View File

@@ -264,6 +264,7 @@
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0 mymob.blind.mouse_opacity = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_alien.dmi' mymob.flash.icon = 'screen1_alien.dmi'

View File

@@ -193,6 +193,7 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_alien.dmi' mymob.flash.icon = 'screen1_alien.dmi'

View File

@@ -28,3 +28,4 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0

View File

@@ -538,6 +538,7 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = ui_style mymob.flash.icon = ui_style

View File

@@ -444,6 +444,7 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = ui_style mymob.flash.icon = ui_style

View File

@@ -70,23 +70,31 @@
/mob/living/get_contents() /mob/living/get_contents()
var/list/L = list() var/list/L = list()
L += src.contents L += src.contents
for(var/obj/item/weapon/storage/S in src.contents) for(var/obj/item/weapon/storage/S in L)
L += S.return_inv() L |= S.return_inv()
for(var/obj/item/weapon/gift/G in src.contents) for(var/obj/item/weapon/gift/G in L)
L += G.gift L |= G.gift
if (istype(G.gift, /obj/item/weapon/storage)) if (istype(G.gift, /obj/item/weapon/storage))
L += G.gift:return_inv() L |= G.gift:return_inv()
for(var/obj/item/weapon/evidencebag/E in L)
L |= E:contents
for(var/obj/item/smallDelivery/S in L)
L |= S.wrapped
return L return L
/mob/living/proc/check_contents_for(A) /mob/living/proc/check_contents_for(A)
var/list/L = list() var/list/L = list()
L += src.contents L += src.contents
for(var/obj/item/weapon/storage/S in src.contents) for(var/obj/item/weapon/storage/S in L)
L += S.return_inv() L |= S.return_inv()
for(var/obj/item/weapon/gift/G in src.contents) for(var/obj/item/weapon/gift/G in L)
L += G.gift L |= G.gift
if (istype(G.gift, /obj/item/weapon/storage)) if (istype(G.gift, /obj/item/weapon/storage))
L += G.gift:return_inv() L |= G.gift:return_inv()
for(var/obj/item/weapon/evidencebag/E in L)
L |= E:contents
for(var/obj/item/smallDelivery/S in L)
L |= S.wrapped
for(var/obj/B in L) for(var/obj/B in L)
if(B.type == A) if(B.type == A)

View File

@@ -217,6 +217,7 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi' mymob.flash.icon = 'screen1_robot.dmi'

View File

@@ -154,8 +154,13 @@
return return
if(Process_Grab()) return if(Process_Grab()) return
if(!mob.canmove) return
//Making mob movememnt changes instant.
if(mob.paralysis || mob.stunned || mob.weakened || mob.buckled || (mob.changeling && mob.changeling.changeling_fakedeath))
mob.canmove = 0
return
else
mob.canmove = 1
if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV)) if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV))
if(!mob.Process_Spacemove(0)) return 0 if(!mob.Process_Spacemove(0)) return 0

View File

@@ -730,7 +730,7 @@ datum/preferences
if(link_tags["underwear"]) if(link_tags["underwear"])
if(!IsGuestKey(user.key)) if(!IsGuestKey(user.key))
switch(link_tags["underwear"]) /*switch(link_tags["underwear"])
if("random") if("random")
if(prob (75)) if(prob (75))
underwear = 1 underwear = 1
@@ -740,7 +740,8 @@ datum/preferences
if(underwear == 1) if(underwear == 1)
underwear = 0 underwear = 0
else else
underwear = 1 underwear = 1*/
underwear = !underwear
if(link_tags["be_special"]) if(link_tags["be_special"])
src.be_special^=(1<<text2num(link_tags["be_special"])) //bitwize magic, sorry for that. --rastaf0 src.be_special^=(1<<text2num(link_tags["be_special"])) //bitwize magic, sorry for that. --rastaf0

View File

@@ -19,28 +19,29 @@
caliber = "" caliber = ""
silenced = 0 silenced = 0
recoil = 0 recoil = 0
tmp/mob/target tmp/list/mob/living/target //List of who yer targeting.
tmp/lock_time = -100 tmp/lock_time = -100
mouthshoot = 0 mouthshoot = 0 ///To stop people from suiciding twice... >.>
automatic = 0 //Used to determine if you can target multiple people.
mob/living/last_moved_mob //Used to fire faster at more than one person.
told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them.
proc proc/load_into_chamber()
load_into_chamber()
special_check(var/mob/M)
load_into_chamber()
return 0 return 0
//Removing the lock and the buttons. //Removing the lock and the buttons.
dropped(mob/user as mob) dropped(mob/user as mob)
if(target) if(target)
target.NotTargeted(src) for(var/mob/living/M in target)
del(user.item_use_icon) if(M)
M.NotTargeted(src) //Untargeting people.
del(target)
del(user.item_use_icon) //Removing the control icons.
del(user.gun_move_icon) del(user.gun_move_icon)
del(user.gun_run_icon) del(user.gun_run_icon)
return ..() return ..()
special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver. proc/special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
return 1 return 1
@@ -51,26 +52,33 @@
//Handling lowering yer gun. //Handling lowering yer gun.
attack_self() attack_self()
if(target) if(target)
target.NotTargeted(src) for(var/mob/living/M in target)
if(M)
M.NotTargeted(src)
del(target)
usr.visible_message("\blue [usr] lowers \the [src]...") usr.visible_message("\blue [usr] lowers \the [src]...")
return 0 return 0
return 1 return 1
//Suiciding. //Suiciding.
attack(mob/living/M as mob, mob/living/user as mob, def_zone) attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (M == user && user.zone_sel.selecting == "mouth" && load_into_chamber() && !mouthshoot) if (M == user && user.zone_sel.selecting == "mouth" && load_into_chamber() && !mouthshoot) //Suicide handling.
mouthshoot = 1 mouthshoot = 1
M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...") M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...")
if(!do_after(user, 40)) if(!do_after(user, 40))
M.visible_message("\blue [user] decided life was worth living") M.visible_message("\blue [user] decided life was worth living")
mouthshoot = 0
return return
if(istype(src.in_chamber, /obj/item/projectile/bullet) && !istype(src.in_chamber, /obj/item/projectile/bullet/stunshot)) if(istype(src.in_chamber, /obj/item/projectile/bullet) && !istype(src.in_chamber, /obj/item/projectile/bullet/stunshot) && !istype(src.in_chamber, /obj/item/ammo_casing/shotgun/beanbag))
M.apply_damage(75, BRUTE, "head", used_weapon = "Suicide attempt with a projectile weapon.") M.apply_damage(75, BRUTE, "head", used_weapon = "Suicide attempt with a projectile weapon.")
M.apply_damage(85, BRUTE, "chest") M.apply_damage(85, BRUTE, "chest")
M.visible_message("\red [user] pulls the trigger.") M.visible_message("\red [user] pulls the trigger.")
else if(istype(src.in_chamber, /obj/item/projectile/bullet/stunshot) || istype(src.in_chamber, /obj/item/projectile/energy/electrode)) else if(istype(src.in_chamber, /obj/item/projectile/bullet/stunshot) || istype(src.in_chamber, /obj/item/projectile/energy/electrode))
M.apply_damage(10, BURN, "head", used_weapon = "Suicide attempt with a stun round.") M.apply_damage(10, BURN, "head", used_weapon = "Suicide attempt with a stun round.")
M.visible_message("\red [user] pulls the trigger, but luckily it was a stun round.") M.visible_message("\red [user] pulls the trigger, but luckily it was a stun round.")
else if(istype(src.in_chamber, /obj/item/ammo_casing/shotgun/beanbag))
M.apply_damage(20, BRUTE, "head", used_weapon = "Suicide attempt with a beanbag.")
M.visible_message("\red [user] pulls the trigger, but luckily it was a stun round.")
else if(istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy)) else if(istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy))
M.apply_damage(75, BURN, "head", used_weapon = "Suicide attempt with an energy weapon") M.apply_damage(75, BURN, "head", used_weapon = "Suicide attempt with an energy weapon")
M.apply_damage(85, BURN, "chest") M.apply_damage(85, BURN, "chest")
@@ -82,17 +90,23 @@
del(in_chamber) del(in_chamber)
mouthshoot = 0 mouthshoot = 0
return return
else if(target && M == target)
PreFire(M,user)
return
else if(user.a_intent == "hurt" && load_into_chamber() && (istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy)\ else if(user.a_intent == "hurt" && load_into_chamber() && (istype(src.in_chamber, /obj/item/projectile/beam) || istype(src.in_chamber, /obj/item/projectile/energy)\
|| istype(src.in_chamber, /obj/item/projectile/bullet))) || istype(src.in_chamber, /obj/item/projectile/bullet)) && !istype(in_chamber,/obj/item/projectile/energy/electrode)) //Point blank shooting.
//Lets shoot them, then. //Lets shoot them, then.
user.visible_message("\red <b> [user] fires \the [src] point blank at [M]!</b>") user.visible_message("\red <b> [user] fires \the [src] point blank at [M]!</b>")
M.apply_damage(30+in_chamber.damage,BRUTE,"Point Blank Shot") //So we'll put him an inch from death. if(silenced)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
M.apply_damage(30+in_chamber.damage, BRUTE, used_weapon = "Point Blank Shot") //So we'll put him an inch from death.
M.attack_log += text("\[[]\] <b>[]/[]</b> shot <b>[]/[]</b> point blank with a <b>[]</b>", time_stamp(), user, user.ckey, M, M.ckey, src)
user.attack_log += text("\[[]\] <b>[]/[]</b> shot <b>[]/[]</b> point blank with a <b>[]</b>", time_stamp(), user, user.ckey, M, M.ckey, src)
log_admin("ATTACK: [user] ([user.ckey]) shot [M] ([M.ckey]) point blank with [src].")
message_admins("ATTACK: [user] ([user.ckey]) shot [M] ([M.ckey]) point blank with [src].")
del(in_chamber) del(in_chamber)
update_icon()
return return
else if(user.a_intent != "hurt" && load_into_chamber() && istype(src,/obj/item/weapon/gun/energy/taser)) else if(user.a_intent != "hurt" && load_into_chamber() && istype(in_chamber,/obj/item/projectile/energy/electrode)) //Point blank tasering.
if (prob(50)) if (prob(50))
if (M.paralysis < 60 && (!(M.mutations & 8)) ) if (M.paralysis < 60 && (!(M.mutations & 8)) )
M.paralysis = 60 M.paralysis = 60
@@ -101,18 +115,33 @@
M.weakened = 60 M.weakened = 60
if (M.stuttering < 60 && (!(M.mutations & 8)) ) if (M.stuttering < 60 && (!(M.mutations & 8)) )
M.stuttering = 60 M.stuttering = 60
if(silenced)
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
user.visible_message("\red <B>[M] has been stunned with the taser gun by [user]!</B>") user.visible_message("\red <B>[M] has been stunned with the taser gun by [user]!</B>")
M.attack_log += text("\[[]\] <b>[]/[]</b> stunned <b>[]/[]</b> with a <b>[]</b>", time_stamp(), user, user.ckey, M, M.ckey, src)
user.attack_log += text("\[[]\] <b>[]/[]</b> stunned <b>[]/[]</b> with a <b>[]</b>", time_stamp(), user, user.ckey, M, M.ckey, src)
log_admin("ATTACK: [user] ([user.ckey]) stunned [M] ([M.ckey]) with [src].")
message_admins("ATTACK: [user] ([user.ckey]) stunned [M] ([M.ckey]) with [src].")
del(in_chamber) del(in_chamber)
update_icon()
return
else if(target && M in target) //Yer targeting them, and 1 tile away. FIRE!
if(!load_into_chamber()) //No ammo, hit them!
return ..()
else
PreFire(M,user) ///Otherwise, shoot!
return return
else else
return ..() return ..() //Pistolwhippin'
//POWPOW!... Used to be afterattack. //POWPOW!... Used to be afterattack.
proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params)//TODO: go over this proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params)//TODO: go over this
if(istype(user, /mob/living)) if(istype(user, /mob/living))
var/mob/living/M = user var/mob/living/M = user
if ((M.mutations & CLUMSY) && prob(50)) if ((M.mutations & CLUMSY) && prob(50)) ///Who ever came up with this...
M << "\red \the [src] blows up in your face." M << "\red \the [src] blows up in your face."
M.take_organ_damage(0,20) M.take_organ_damage(0,20)
M.drop_item() M.drop_item()
@@ -132,9 +161,7 @@
if(!special_check(user)) return if(!special_check(user)) return
if(!load_into_chamber()) if(!load_into_chamber())
user << "\red *click*"; user.visible_message("*click click*", "\red <b>*click*</b>")
for(var/mob/M in orange(4,src.loc))
M.show_message("*click, click*")
return return
if(!in_chamber) return if(!in_chamber) return
@@ -174,7 +201,7 @@
in_chamber.p_y = text2num(mouse_control["icon-y"]) in_chamber.p_y = text2num(mouse_control["icon-y"])
spawn() spawn()
if(in_chamber) in_chamber.process() if(in_chamber) in_chamber.fired()
sleep(1) sleep(1)
in_chamber = null in_chamber = null
@@ -184,11 +211,14 @@
//Aiming at the target mob. //Aiming at the target mob.
proc/Aim(var/mob/M) proc/Aim(var/mob/M)
if(target != M) if(!target || !(M in target))
lock_time = world.time lock_time = world.time
if(target) if(target && !automatic) //If they're targeting someone and they have a non automatic weapon.
//usr.ClearRequest("Aim") //usr.ClearRequest("Aim")
target.NotTargeted(src) for(var/mob/living/L in target)
if(L)
L.NotTargeted(src)
del(target)
usr.visible_message("\red <b>[usr] turns \the [src] on [M]!</b>") usr.visible_message("\red <b>[usr] turns \the [src] on [M]!</b>")
else else
usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>") usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>")
@@ -198,15 +228,29 @@
//HE MOVED, SHOOT HIM! //HE MOVED, SHOOT HIM!
proc/TargetActed() proc/TargetActed(var/mob/living/T)
var/mob/M = loc var/mob/living/M = loc
if(target == M) return if(M == T) return
if(src != M.equipped()) if(!istype(M) || src != M.equipped())
target.NotTargeted(src) for(var/mob/living/N in target)
if(N)
N.NotTargeted(src)
del(target)
return return
usr.last_move_intent = world.time M.last_move_intent = world.time
Fire(target,usr) if(load_into_chamber())
var/dir_to_fire = sd_get_approx_dir(M,target) var/firing_check = in_chamber.check_fire(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing.
if(firing_check > 0)
if(firing_check == 1)
Fire(T,usr)
else if(!told_cant_shoot)
M << "\red They can't be hit from here!"
told_cant_shoot = 1
spawn(30)
told_cant_shoot = 0
else
usr.visible_message("*click click*", "\red <b>*click*</b>")
var/dir_to_fire = sd_get_approx_dir(M,T)
if(dir_to_fire != M.dir) if(dir_to_fire != M.dir)
M.dir = dir_to_fire M.dir = dir_to_fire
@@ -214,30 +258,32 @@
if(flag) return //we're placing gun on a table or in backpack if(flag) return //we're placing gun on a table or in backpack
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this? if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
if(user && user.client && user.client.gun_mode) if(user && user.client && user.client.gun_mode)
PreFire(A,user,params) PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at.
else else
Fire(A,user,params) Fire(A,user,params) //Otherwise, fire normally.
//Compute how to fire..... //Compute how to fire.....
proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params)
//GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z) //GraphicTrace(usr.x,usr.y,A.x,A.y,usr.z)
if(lock_time > world.time - 2) return if(lock_time > world.time - 2) return //Lets not spam it.
if(!ismob(A)) if(!ismob(A)) //Didn't click someone, check if there is anyone along that guntrace
// var/mob/M = locate() in range(0,A) // var/mob/M = locate() in range(0,A)
// if(M && !ismob(A)) // if(M && !ismob(A))
// if(M.type == /mob) // if(M.type == /mob)
// return FindTarget(M,user,params) // return FindTarget(M,user,params)
var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) //Find dat mob.
if(M && ismob(M) && isliving(M) && !target) if(M && ismob(M) && isliving(M) && M in view(user))
if(!(M.client && M.client.admin_invis)) if(!(M.client && M.client.admin_invis))
Aim(M) Aim(M) //Aha! Aim at them!
return return
if(ismob(A) && isliving(A) && target != A) else if(!ismob(M) || (ismob(M) && !(M in view(user)))) //Nope! They weren't there!
Aim(A) Fire(A,user,params) //Fire like normal, then.
if(ismob(A) && isliving(A) && !(A in target))
Aim(A) //Clicked a mob, aim at them.
else if(lock_time < world.time + 10) else if(lock_time < world.time + 10)
Fire(A,user,params) Fire(A,user,params) //Bang!
else if(!target) else if(!target)
Fire(A,user,params) Fire(A,user,params) //Boom!
//else //else
//var/item/gun/G = usr.OHand //var/item/gun/G = usr.OHand
//if(!G) //if(!G)
@@ -247,7 +293,7 @@
//Fire(A,2) //Fire(A,2)
//else //else
//Fire(A) //Fire(A)
var/dir_to_fire = sd_get_approx_dir(usr,A) var/dir_to_fire = sd_get_approx_dir(usr,A) //Turn them to face their target.
if(dir_to_fire != usr.dir) if(dir_to_fire != usr.dir)
usr.dir = dir_to_fire usr.dir = dir_to_fire
@@ -303,20 +349,36 @@ mob/var
obj/effect/target_locked/target_locked = null obj/effect/target_locked/target_locked = null
mob/proc mob/proc
Targeted(var/obj/item/weapon/gun/I) Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
if(!I.target)
I.target = list(src)
else if(I.automatic && I.target.len < 5) //Automatic weapon, they can hold down a room.
I.target += src
else if(I.target.len >= 5) //Otherwise, they can just aim at one person.
if(ismob(I.loc))
I.loc << "You can only target 5 people at once!"
return
else
return
if(!targeted_by) targeted_by = list() if(!targeted_by) targeted_by = list()
targeted_by += I targeted_by += I
I.target = src I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent).
I.lock_time = world.time + 20 //Target has 1 second to realize they're targeted and stop (or target the opponent).
src << "((\red <b>Your character is being targeted. They have 2 seconds to stop any click or move actions.</b> \black While targeted, they may \ src << "((\red <b>Your character is being targeted. They have 2 seconds to stop any click or move actions.</b> \black While targeted, they may \
drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map, their items \ drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map, their items \
(other than a weapon to de-target), or moving will result in being fired upon. \red The aggressor may also fire manually, \ (other than a weapon to de-target), or moving will result in being fired upon. \red The aggressor may also fire manually, \
so try not to get on their bad side.\black ))" so try not to get on their bad side.\black ))"
if(targeted_by.len == 1) if(targeted_by.len == 1)
spawn(0) spawn(0)
target_locked = new /obj/effect/target_locked(src) target_locked = new /obj/effect/target_locked(src) //Add the overlay
overlays += target_locked overlays += target_locked
spawn flick("locking",target_locked) spawn(0) //Make it show the 2 states properly
if(target_locked)
target_locked.icon_state = "locking"
update_clothing()
sleep(20)
if(target_locked)
target_locked.icon_state = "locked"
update_clothing()
var/mob/T = I.loc var/mob/T = I.loc
//Adding the buttons to the controler person //Adding the buttons to the controler person
if(T) if(T)
@@ -325,32 +387,47 @@ mob/proc
if(T.client) if(T.client)
T.client.screen += T.item_use_icon T.client.screen += T.item_use_icon
T.client.screen += T.gun_move_icon T.client.screen += T.gun_move_icon
if(m_intent == "run" && T.client && T.client.target_can_move == 1 && T.client.target_can_run == 0)
src << "\red Your move intent is now set to walk, as your targeter permits it." //Self explanitory.
m_intent = "walk"
hud_used.move_intent.icon_state = "walking"
while(targeted_by && T.client) while(targeted_by && T.client)
sleep(1) sleep(1)
if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If the target moved while targeted if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If the target moved while targeted
I.TargetActed() I.TargetActed(src)
I.lock_time = world.time + 10 if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
I.lock_time = world.time + 5
I.lock_time = world.time + 5
I.last_moved_mob = src
else if(last_move_intent > I.lock_time + 10 && !T.client.target_can_run && m_intent == "run") //If the target ran while targeted else if(last_move_intent > I.lock_time + 10 && !T.client.target_can_run && m_intent == "run") //If the target ran while targeted
I.TargetActed() I.TargetActed(src)
I.lock_time = world.time + 10 if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
I.lock_time = world.time + 5
I.lock_time = world.time + 5
I.last_moved_mob = src
if(last_target_click > I.lock_time + 10 && !T.client.target_can_click) //If the target clicked the map to pick something up/shoot/etc if(last_target_click > I.lock_time + 10 && !T.client.target_can_click) //If the target clicked the map to pick something up/shoot/etc
I.TargetActed() I.TargetActed(src)
I.lock_time = world.time + 10 if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better.
I.lock_time = world.time + 5
I.lock_time = world.time + 5
I.last_moved_mob = src
NotTargeted(var/obj/item/weapon/gun/I,silent) NotTargeted(var/obj/item/weapon/gun/I)
if(!silent) if(!I.silenced)
for(var/mob/M in viewers(src)) for(var/mob/M in viewers(src))
M << 'TargetOff.ogg' M << 'TargetOff.ogg'
del(target_locked) del(target_locked) //Remove the overlay
targeted_by -= I targeted_by -= I
I.target = null I.target.Remove(src) //De-target them
var/mob/T = I.loc if(!I.target.len)
if(T && ismob(T)) del(I.target)
var/mob/T = I.loc //Remove the targeting icons
if(T && ismob(T) && !I.target)
del(T.item_use_icon) del(T.item_use_icon)
del(T.gun_move_icon) del(T.gun_move_icon)
del(T.gun_run_icon) del(T.gun_run_icon)
if(!targeted_by.len) del targeted_by if(!targeted_by.len) del targeted_by
spawn(1) update_clothing() spawn(1) update_clothing() //Finally, update the image.
/* Captive(var/obj/item/weapon/gun/I) /* Captive(var/obj/item/weapon/gun/I)
Sound(src,'CounterAttack.ogg') Sound(src,'CounterAttack.ogg')
@@ -400,16 +477,17 @@ client/var
gun_mode = 0 gun_mode = 0
mob/Move() mob/Move()
. = ..() . = ..()
for(var/obj/item/weapon/gun/G in targeted_by) for(var/obj/item/weapon/gun/G in targeted_by) //Handle moving out of the gunner's view.
var/mob/M = G.loc var/mob/M = G.loc
if(!(M in view(src))) if(!(M in view(src)))
//ClearRequest("Aim") //ClearRequest("Aim")
NotTargeted(G) NotTargeted(G)
for(var/obj/item/weapon/gun/G in src) for(var/obj/item/weapon/gun/G in src) //Handle the gunner loosing sight of their target/s
if(G.target) if(G.target)
if(!(G.target in view(src))) for(var/mob/living/M in G.target)
if(M && !(M in view(src)))
//ClearRequest("Aim") //ClearRequest("Aim")
G.target.NotTargeted(G) M.NotTargeted(G)
client/verb client/verb
//These are called by the on-screen buttons, adjusting what the victim can and cannot do. //These are called by the on-screen buttons, adjusting what the victim can and cannot do.
AllowTargetMove() AllowTargetMove()
@@ -434,10 +512,15 @@ client/verb
for(var/obj/item/weapon/gun/G in usr) for(var/obj/item/weapon/gun/G in usr)
G.lock_time = world.time + 5 G.lock_time = world.time + 5
if(G.target) if(G.target)
for(var/mob/living/M in G.target)
if(!target_can_move) if(!target_can_move)
G.target << "Your character may now <b>walk</b> at the discretion of their targeter." M << "Your character may now <b>walk</b> at the discretion of their targeter."
if(!target_can_run)
M << "\red Your move intent is now set to walk, as your targeter permits it."
M.m_intent = "walk"
M.hud_used.move_intent.icon_state = "walking"
else else
G.target << "\red <b>Your character will now be shot if they move.</b>" M << "\red <b>Your character will now be shot if they move.</b>"
AllowTargetRun() AllowTargetRun()
set hidden=1 set hidden=1
spawn(1) target_can_run = !target_can_run spawn(1) target_can_run = !target_can_run
@@ -456,10 +539,11 @@ client/verb
for(var/obj/item/weapon/gun/G in src) for(var/obj/item/weapon/gun/G in src)
G.lock_time = world.time + 5 G.lock_time = world.time + 5
if(G.target) if(G.target)
for(var/mob/living/M in G.target)
if(!target_can_run) if(!target_can_run)
G.target << "Your character may now <b>run</b> at the discretion of their targeter." M << "Your character may now <b>run</b> at the discretion of their targeter."
else else
G.target << "\red <b>Your character will now be shot if they run.</b>" M << "\red <b>Your character will now be shot if they run.</b>"
AllowTargetClick() AllowTargetClick()
set hidden=1 set hidden=1
spawn(1) target_can_click = !target_can_click spawn(1) target_can_click = !target_can_click
@@ -478,10 +562,11 @@ client/verb
for(var/obj/item/weapon/gun/G in src) for(var/obj/item/weapon/gun/G in src)
G.lock_time = world.time + 5 G.lock_time = world.time + 5
if(G.target) if(G.target)
for(var/mob/living/M in G.target)
if(!target_can_click) if(!target_can_click)
G.target << "Your character may now <b>use items</b> at the discretion of their targeter." M << "Your character may now <b>use items</b> at the discretion of their targeter."
else else
G.target << "\red <b>Your character will now be shot if they use items.</b>" M << "\red <b>Your character will now be shot if they use items.</b>"
ToggleGunMode() ToggleGunMode()
set hidden = 1 set hidden = 1

View File

@@ -27,7 +27,11 @@
load_into_chamber() load_into_chamber()
if(in_chamber) return 1 if(in_chamber)
if(!istype(in_chamber, projectile_type))
del(in_chamber)
in_chamber = new projectile_type(src)
return 1
if(!power_supply) return 0 if(!power_supply) return 0
if(!power_supply.use(charge_cost)) return 0 if(!power_supply.use(charge_cost)) return 0
if(!projectile_type) return 0 if(!projectile_type) return 0

View File

@@ -47,7 +47,11 @@ obj/item/weapon/gun/energy/laser/retro
/obj/item/weapon/gun/energy/laser/cyborg/load_into_chamber() /obj/item/weapon/gun/energy/laser/cyborg/load_into_chamber()
if(in_chamber) return 1 if(in_chamber)
if(!istype(in_chamber, projectile_type))
del(in_chamber)
in_chamber = new projectile_type(src)
return 1
if(isrobot(src.loc)) if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc var/mob/living/silicon/robot/R = src.loc
if(R && R.cell) if(R && R.cell)

View File

@@ -7,6 +7,7 @@
charge_cost = 200 charge_cost = 200
projectile_type = "/obj/item/projectile/beam/pulse" projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/cell/super" cell_type = "/obj/item/weapon/cell/super"
automatic = 1
var/mode = 2 var/mode = 2

View File

@@ -13,6 +13,9 @@
/obj/item/weapon/gun/energy/taser/cyborg/load_into_chamber()//TOOD: change this over to the slowly recharge other cell /obj/item/weapon/gun/energy/taser/cyborg/load_into_chamber()//TOOD: change this over to the slowly recharge other cell
if(in_chamber) if(in_chamber)
if(!istype(in_chamber, projectile_type))
del(in_chamber)
in_chamber = new projectile_type(src)
return 1 return 1
if(isrobot(src.loc)) if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc var/mob/living/silicon/robot/R = src.loc

View File

@@ -6,7 +6,7 @@
origin_tech = "combat=2;materials=2" origin_tech = "combat=2;materials=2"
w_class = 3.0 w_class = 3.0
m_amt = 1000 m_amt = 1000
force = 30 //Pistol whipp'n good. (It was frigging SIXTY on pre-goon code) force = 10 //Pistol whipp'n good. (It was frigging SIXTY on pre-goon code)
var var
ammo_type = "/obj/item/ammo_casing/a357" ammo_type = "/obj/item/ammo_casing/a357"
@@ -25,6 +25,7 @@
load_into_chamber() load_into_chamber()
if(in_chamber) return 1
if(!loaded.len) return 0 if(!loaded.len) return 0
var/obj/item/ammo_casing/AC = loaded[1] //load next casing. var/obj/item/ammo_casing/AC = loaded[1] //load next casing.

View File

@@ -7,6 +7,7 @@
caliber = "9mm" caliber = "9mm"
origin_tech = "combat=4;materials=2" origin_tech = "combat=4;materials=2"
ammo_type = "/obj/item/ammo_casing/c9mm" ammo_type = "/obj/item/ammo_casing/c9mm"
automatic = 1

View File

@@ -55,6 +55,20 @@
return 1 return 1
proc/check_fire(var/mob/living/target as mob, var/mob/living/user as mob) //Checks if you can hit them or not.
if(!istype(target) || !istype(user))
return 0
var/obj/item/projectile/test/in_chamber = new /obj/item/projectile/test(get_turf(src)) //Making the test....
var/turf/curloc = get_turf(user)
var/turf/targloc = get_turf(target)
in_chamber.yo = targloc.y - curloc.y
in_chamber.xo = targloc.x - curloc.x
in_chamber.flags = flags //Set the flags...
in_chamber.pass_flags = pass_flags //And the pass flags to that of the real projectile...
var/output = in_chamber.fired() //Test it!
del(in_chamber) //No need for it anymore
return output //Send it back to the gun!
Bump(atom/A as mob|obj|turf|area) Bump(atom/A as mob|obj|turf|area)
if(A == firer) if(A == firer)
loc = A.loc loc = A.loc
@@ -115,7 +129,7 @@
return 1 return 1
process() proc/fired()
spawn while(src) spawn while(src)
if((!( current ) || loc == current)) if((!( current ) || loc == current))
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
@@ -130,3 +144,30 @@
Bump(M) Bump(M)
sleep(1) sleep(1)
return return
/obj/item/projectile/test //Used to see if you can hit them.
invisibility = 101 //Nope! Can't see me!
yo = null
xo = null
var
turf/target = null
result = 0 //To pass the message back to the gun.
Bump(atom/A as mob|obj|turf|area)
if(istype(A, /mob/living))
result = 2 //We hit someone, return 1!
return ..()
fired()
target = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) //Finding the target turf at map edge
while(!result) //Loop on through!
if(!step_towards(src,target)) //If we hit something...
if(!result) //And the var is not already set....
result = 1 //Return 0
break
else
var/mob/living/M = locate() in get_turf(src)
if(istype(M)) //If there is someting living...
result = 2 //Return 1
break
return (result-1)

View File

@@ -9,7 +9,7 @@
var/ID = 0 var/ID = 0
var/main = 0 var/main = 0
process() fired()
main = 1 main = 1
ID = rand(0,1000) ID = rand(0,1000)
var/first = 1 var/first = 1
@@ -34,7 +34,6 @@
new_beam.icon_state = icon_state new_beam.icon_state = icon_state
else else
first = 0 first = 0
processing_objects.Remove(src)
return return
/obj/effect/effect/laserdealer /obj/effect/effect/laserdealer

View File

@@ -15,6 +15,12 @@
stutter = 10 stutter = 10
flag = "laser" //Give it a better chance to be blocked. flag = "laser" //Give it a better chance to be blocked.
check_fire(var/mob/living/target as mob, var/mob/living/user as mob)
if((target.stunned + target.weakened) > 30)
return 2
else
return ..()
/obj/item/projectile/energy/declone /obj/item/projectile/energy/declone
name = "\improper Decloner Bolt" name = "\improper Decloner Bolt"

View File

@@ -174,6 +174,8 @@
afterattack(var/obj/target as obj, mob/user as mob) afterattack(var/obj/target as obj, mob/user as mob)
if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) || istype(target,/obj/item/smallDelivery)) if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) || istype(target,/obj/item/smallDelivery))
return return
if(!istype(target,/obj))
return
if(target.anchored) if(target.anchored)
return return
if(target in user) if(target in user)

View File

@@ -217,6 +217,7 @@
mymob.blind.name = " " mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15" mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0 mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null ) mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi' mymob.flash.icon = 'screen1_robot.dmi'