diff --git a/code/defines/obj/clothing/jumpsuit.dm b/code/defines/obj/clothing/jumpsuit.dm
index e94c4482e7a..a6b2d3c1f49 100644
--- a/code/defines/obj/clothing/jumpsuit.dm
+++ b/code/defines/obj/clothing/jumpsuit.dm
@@ -29,6 +29,7 @@
desc = "A plain jumpsuit. It seems to have a small dial on the wrist."
origin_tech = "syndicate=3"
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
item_state = "bl_suit"
diff --git a/code/defines/turf.dm b/code/defines/turf.dm
index a91921f9567..bf567accc7d 100644
--- a/code/defines/turf.dm
+++ b/code/defines/turf.dm
@@ -47,7 +47,7 @@
/turf/space/New()
// 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
name = "station"
diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm
index 90045f9845f..771d8a1dd80 100644
--- a/code/game/atom_procs.dm
+++ b/code/game/atom_procs.dm
@@ -126,7 +126,7 @@
if(src.fingerprints.len == 1)
src.fingerprints = list()
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.len--
else
diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm
index 2459e87bc70..f0ecb88ddca 100644
--- a/code/game/gamemodes/autotraitor/autotraitor.dm
+++ b/code/game/gamemodes/autotraitor/autotraitor.dm
@@ -15,12 +15,6 @@
/datum/game_mode/traitor/autotraitor/pre_setup()
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)
if(P.client && P.ready)
num_players++
@@ -84,11 +78,6 @@
traitorcount += 1
if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate"))
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 Traitors: [traitorcount]")
// message_admins("Potential Traitors:")
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index 2bd03a3bd13..86246238a58 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -39,7 +39,7 @@ Stealthy and Inconspicuous Weapons;
/obj/item/weapon/cartridge/syndicate:3:Detomatix PDA Cartridge;
Whitespace:Seperator;
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/weapon/card/id/syndicate:3:Agent ID card;
/obj/item/clothing/mask/gas/voice:4:Voice Changer;
diff --git a/code/game/objects/items/clothing.dm b/code/game/objects/items/clothing.dm
index 602a0288154..606c69229da 100644
--- a/code/game/objects/items/clothing.dm
+++ b/code/game/objects/items/clothing.dm
@@ -114,10 +114,10 @@ THERMAL GLASSES
var/obj/item/clothing/under/V = new U
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
- src.clothing_choices += V
+// var/obj/item/clothing/under/V = new U
+// src.clothing_choices += V
return
@@ -163,7 +163,7 @@ THERMAL GLASSES
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)
return
@@ -410,4 +410,4 @@ THERMAL GLASSES
src.flags &= ~HEADCOVERSEYES
icon_state = "engspace_helmet_clear"
usr << "You toggle the reflective tint off."
- usr.update_clothing()
\ No newline at end of file
+ usr.update_clothing()
diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm
index 4a9d0da87fd..9b9e1fb1710 100644
--- a/code/game/objects/radio/radio.dm
+++ b/code/game/objects/radio/radio.dm
@@ -243,107 +243,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (!connection)
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*",
- src, message, from, "Automated Announcement", from, "synthesized voice",
- filter_type, signal.data["compression"])
+ src, message, from, "Automated Announcement", from, "synthesized voice", 4, 0)
return
/obj/item/device/radio/talk_into(mob/M as mob, message, channel)
diff --git a/code/game/objects/storage/crates.dm b/code/game/objects/storage/crates.dm
index edb8ccc4c4f..0ad00b3a4c7 100644
--- a/code/game/objects/storage/crates.dm
+++ b/code/game/objects/storage/crates.dm
@@ -286,6 +286,8 @@
user.drop_item()
if(W)
W.loc = src.loc
+ else if(istype(W,/obj/item/weapon/packageWrap))
+ return
else return attack_hand(user)
/obj/structure/closet/crate/secure/emp_act(severity)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index c7a2f07f27c..d61a98881a8 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -3,7 +3,7 @@
/proc/message_admins(var/text, var/admin_ref = 0)
var/rendered = "ADMIN LOG: [text]"
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)
M << dd_replaceText(rendered, "%admin_ref%", "\ref[M]")
else
diff --git a/code/modules/mob/living/carbon/alien/humanoid/hud.dm b/code/modules/mob/living/carbon/alien/humanoid/hud.dm
index ec2a726538d..cbcb149464e 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/hud.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/hud.dm
@@ -264,6 +264,7 @@
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_alien.dmi'
diff --git a/code/modules/mob/living/carbon/alien/larva/hud.dm b/code/modules/mob/living/carbon/alien/larva/hud.dm
index d8e976a8e8f..cfe29e2b5e7 100644
--- a/code/modules/mob/living/carbon/alien/larva/hud.dm
+++ b/code/modules/mob/living/carbon/alien/larva/hud.dm
@@ -193,6 +193,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_alien.dmi'
diff --git a/code/modules/mob/living/carbon/brain/hud.dm b/code/modules/mob/living/carbon/brain/hud.dm
index a15ff458e87..0a2a2f226fb 100644
--- a/code/modules/mob/living/carbon/brain/hud.dm
+++ b/code/modules/mob/living/carbon/brain/hud.dm
@@ -27,4 +27,5 @@
mymob.blind.icon_state = "blackanimate"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
- mymob.blind.layer = 0
\ No newline at end of file
+ mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm
index 0748588199a..02f6974676f 100644
--- a/code/modules/mob/living/carbon/human/hud.dm
+++ b/code/modules/mob/living/carbon/human/hud.dm
@@ -538,6 +538,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = ui_style
diff --git a/code/modules/mob/living/carbon/monkey/hud.dm b/code/modules/mob/living/carbon/monkey/hud.dm
index f41726cf1dc..579edf18e6a 100644
--- a/code/modules/mob/living/carbon/monkey/hud.dm
+++ b/code/modules/mob/living/carbon/monkey/hud.dm
@@ -444,6 +444,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = ui_style
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 865c29e217c..f95bf469a4d 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -70,23 +70,31 @@
/mob/living/get_contents()
var/list/L = list()
L += src.contents
- for(var/obj/item/weapon/storage/S in src.contents)
- L += S.return_inv()
- for(var/obj/item/weapon/gift/G in src.contents)
- L += G.gift
+ for(var/obj/item/weapon/storage/S in L)
+ L |= S.return_inv()
+ for(var/obj/item/weapon/gift/G in L)
+ L |= G.gift
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
/mob/living/proc/check_contents_for(A)
var/list/L = list()
L += src.contents
- for(var/obj/item/weapon/storage/S in src.contents)
- L += S.return_inv()
- for(var/obj/item/weapon/gift/G in src.contents)
- L += G.gift
+ for(var/obj/item/weapon/storage/S in L)
+ L |= S.return_inv()
+ for(var/obj/item/weapon/gift/G in L)
+ L |= G.gift
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)
if(B.type == A)
diff --git a/code/modules/mob/living/silicon/robot/hud.dm b/code/modules/mob/living/silicon/robot/hud.dm
index fb8c6397199..691b0a98065 100644
--- a/code/modules/mob/living/silicon/robot/hud.dm
+++ b/code/modules/mob/living/silicon/robot/hud.dm
@@ -217,6 +217,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi'
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 0b6f753d3d1..d30fc1ab884 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -154,8 +154,13 @@
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(!mob.Process_Spacemove(0)) return 0
diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm
index f3c1755db16..577c29d74e6 100644
--- a/code/modules/mob/new_player/preferences.dm
+++ b/code/modules/mob/new_player/preferences.dm
@@ -730,7 +730,7 @@ datum/preferences
if(link_tags["underwear"])
if(!IsGuestKey(user.key))
- switch(link_tags["underwear"])
+ /*switch(link_tags["underwear"])
if("random")
if(prob (75))
underwear = 1
@@ -740,7 +740,8 @@ datum/preferences
if(underwear == 1)
underwear = 0
else
- underwear = 1
+ underwear = 1*/
+ underwear = !underwear
if(link_tags["be_special"])
src.be_special^=(1<.>
+ 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
- load_into_chamber()
- special_check(var/mob/M)
-
-
- load_into_chamber()
+ proc/load_into_chamber()
return 0
//Removing the lock and the buttons.
dropped(mob/user as mob)
if(target)
- target.NotTargeted(src)
- del(user.item_use_icon)
+ for(var/mob/living/M in target)
+ 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_run_icon)
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
@@ -51,26 +52,33 @@
//Handling lowering yer gun.
attack_self()
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]...")
return 0
return 1
//Suiciding.
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
M.visible_message("\red [user] sticks their gun in their mouth, ready to pull the trigger...")
if(!do_after(user, 40))
M.visible_message("\blue [user] decided life was worth living")
+ mouthshoot = 0
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(85, BRUTE, "chest")
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))
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.")
+ 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))
M.apply_damage(75, BURN, "head", used_weapon = "Suicide attempt with an energy weapon")
M.apply_damage(85, BURN, "chest")
@@ -82,17 +90,23 @@
del(in_chamber)
mouthshoot = 0
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)\
- || 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.
user.visible_message("\red [user] fires \the [src] point blank at [M]!")
- 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("\[[]\] []/[] shot []/[] point blank with a []", time_stamp(), user, user.ckey, M, M.ckey, src)
+ user.attack_log += text("\[[]\] []/[] shot []/[] point blank with a []", 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)
+ update_icon()
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 (M.paralysis < 60 && (!(M.mutations & 8)) )
M.paralysis = 60
@@ -101,18 +115,33 @@
M.weakened = 60
if (M.stuttering < 60 && (!(M.mutations & 8)) )
M.stuttering = 60
+ if(silenced)
+ playsound(user, fire_sound, 10, 1)
+ else
+ playsound(user, fire_sound, 50, 1)
user.visible_message("\red [M] has been stunned with the taser gun by [user]!")
+ M.attack_log += text("\[[]\] []/[] stunned []/[] with a []", time_stamp(), user, user.ckey, M, M.ckey, src)
+ user.attack_log += text("\[[]\] []/[] stunned []/[] with a []", 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)
+ 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
else
- return ..()
+ return ..() //Pistolwhippin'
//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
if(istype(user, /mob/living))
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.take_organ_damage(0,20)
M.drop_item()
@@ -132,9 +161,7 @@
if(!special_check(user)) return
if(!load_into_chamber())
- user << "\red *click*";
- for(var/mob/M in orange(4,src.loc))
- M.show_message("*click, click*")
+ user.visible_message("*click click*", "\red *click*")
return
if(!in_chamber) return
@@ -174,7 +201,7 @@
in_chamber.p_y = text2num(mouse_control["icon-y"])
spawn()
- if(in_chamber) in_chamber.process()
+ if(in_chamber) in_chamber.fired()
sleep(1)
in_chamber = null
@@ -184,11 +211,14 @@
//Aiming at the target mob.
proc/Aim(var/mob/M)
- if(target != M)
+ if(!target || !(M in target))
lock_time = world.time
- if(target)
+ if(target && !automatic) //If they're targeting someone and they have a non automatic weapon.
//usr.ClearRequest("Aim")
- target.NotTargeted(src)
+ for(var/mob/living/L in target)
+ if(L)
+ L.NotTargeted(src)
+ del(target)
usr.visible_message("\red [usr] turns \the [src] on [M]!")
else
usr.visible_message("\red [usr] aims \a [src] at [M]!")
@@ -198,15 +228,29 @@
//HE MOVED, SHOOT HIM!
- proc/TargetActed()
- var/mob/M = loc
- if(target == M) return
- if(src != M.equipped())
- target.NotTargeted(src)
+ proc/TargetActed(var/mob/living/T)
+ var/mob/living/M = loc
+ if(M == T) return
+ if(!istype(M) || src != M.equipped())
+ for(var/mob/living/N in target)
+ if(N)
+ N.NotTargeted(src)
+ del(target)
return
- usr.last_move_intent = world.time
- Fire(target,usr)
- var/dir_to_fire = sd_get_approx_dir(M,target)
+ M.last_move_intent = world.time
+ if(load_into_chamber())
+ 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 *click*")
+ var/dir_to_fire = sd_get_approx_dir(M,T)
if(dir_to_fire != M.dir)
M.dir = dir_to_fire
@@ -214,30 +258,32 @@
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(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
- Fire(A,user,params)
+ Fire(A,user,params) //Otherwise, fire normally.
//Compute how to fire.....
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)
- if(lock_time > world.time - 2) return
- if(!ismob(A))
+ if(lock_time > world.time - 2) return //Lets not spam it.
+ if(!ismob(A)) //Didn't click someone, check if there is anyone along that guntrace
// var/mob/M = locate() in range(0,A)
// if(M && !ismob(A))
// if(M.type == /mob)
// return FindTarget(M,user,params)
- var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr)
- if(M && ismob(M) && isliving(M) && !target)
+ var/mob/M = GunTrace(usr.x,usr.y,A.x,A.y,usr.z,usr) //Find dat mob.
+ if(M && ismob(M) && isliving(M) && M in view(user))
if(!(M.client && M.client.admin_invis))
- Aim(M)
+ Aim(M) //Aha! Aim at them!
return
- if(ismob(A) && isliving(A) && target != A)
- Aim(A)
+ else if(!ismob(M) || (ismob(M) && !(M in view(user)))) //Nope! They weren't there!
+ 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)
- Fire(A,user,params)
+ Fire(A,user,params) //Bang!
else if(!target)
- Fire(A,user,params)
+ Fire(A,user,params) //Boom!
//else
//var/item/gun/G = usr.OHand
//if(!G)
@@ -247,7 +293,7 @@
//Fire(A,2)
//else
//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)
usr.dir = dir_to_fire
@@ -303,20 +349,36 @@ mob/var
obj/effect/target_locked/target_locked = null
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()
targeted_by += I
- I.target = src
- I.lock_time = world.time + 20 //Target has 1 second to realize they're targeted and stop (or target the opponent).
+ I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent).
src << "((\red Your character is being targeted. They have 2 seconds to stop any click or move actions. \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 \
(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 ))"
if(targeted_by.len == 1)
spawn(0)
- target_locked = new /obj/effect/target_locked(src)
+ target_locked = new /obj/effect/target_locked(src) //Add the overlay
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
//Adding the buttons to the controler person
if(T)
@@ -325,32 +387,47 @@ mob/proc
if(T.client)
T.client.screen += T.item_use_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)
sleep(1)
if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If the target moved while targeted
- I.TargetActed()
- I.lock_time = world.time + 10
+ I.TargetActed(src)
+ 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
- I.TargetActed()
- I.lock_time = world.time + 10
+ I.TargetActed(src)
+ 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
- I.TargetActed()
- I.lock_time = world.time + 10
+ I.TargetActed(src)
+ 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)
- if(!silent)
+ NotTargeted(var/obj/item/weapon/gun/I)
+ if(!I.silenced)
for(var/mob/M in viewers(src))
M << 'TargetOff.ogg'
- del(target_locked)
+ del(target_locked) //Remove the overlay
targeted_by -= I
- I.target = null
- var/mob/T = I.loc
- if(T && ismob(T))
+ I.target.Remove(src) //De-target them
+ if(!I.target.len)
+ 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.gun_move_icon)
del(T.gun_run_icon)
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)
Sound(src,'CounterAttack.ogg')
@@ -400,16 +477,17 @@ client/var
gun_mode = 0
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
if(!(M in view(src)))
//ClearRequest("Aim")
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 in view(src)))
- //ClearRequest("Aim")
- G.target.NotTargeted(G)
+ for(var/mob/living/M in G.target)
+ if(M && !(M in view(src)))
+ //ClearRequest("Aim")
+ M.NotTargeted(G)
client/verb
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
AllowTargetMove()
@@ -434,10 +512,15 @@ client/verb
for(var/obj/item/weapon/gun/G in usr)
G.lock_time = world.time + 5
if(G.target)
- if(!target_can_move)
- G.target << "Your character may now walk at the discretion of their targeter."
- else
- G.target << "\red Your character will now be shot if they move."
+ for(var/mob/living/M in G.target)
+ if(!target_can_move)
+ M << "Your character may now walk 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
+ M << "\red Your character will now be shot if they move."
AllowTargetRun()
set hidden=1
spawn(1) target_can_run = !target_can_run
@@ -456,10 +539,11 @@ client/verb
for(var/obj/item/weapon/gun/G in src)
G.lock_time = world.time + 5
if(G.target)
- if(!target_can_run)
- G.target << "Your character may now run at the discretion of their targeter."
- else
- G.target << "\red Your character will now be shot if they run."
+ for(var/mob/living/M in G.target)
+ if(!target_can_run)
+ M << "Your character may now run at the discretion of their targeter."
+ else
+ M << "\red Your character will now be shot if they run."
AllowTargetClick()
set hidden=1
spawn(1) target_can_click = !target_can_click
@@ -478,10 +562,11 @@ client/verb
for(var/obj/item/weapon/gun/G in src)
G.lock_time = world.time + 5
if(G.target)
- if(!target_can_click)
- G.target << "Your character may now use items at the discretion of their targeter."
- else
- G.target << "\red Your character will now be shot if they use items."
+ for(var/mob/living/M in G.target)
+ if(!target_can_click)
+ M << "Your character may now use items at the discretion of their targeter."
+ else
+ M << "\red Your character will now be shot if they use items."
ToggleGunMode()
set hidden = 1
diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm
index 84d069df95f..9d58d3d39ab 100644
--- a/code/modules/projectiles/guns/energy.dm
+++ b/code/modules/projectiles/guns/energy.dm
@@ -27,7 +27,11 @@
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.use(charge_cost)) return 0
if(!projectile_type) return 0
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index ebe73507f73..207e60f114c 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -47,7 +47,11 @@ obj/item/weapon/gun/energy/laser/retro
/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))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm
index 79814620688..2146d065e42 100644
--- a/code/modules/projectiles/guns/energy/pulse.dm
+++ b/code/modules/projectiles/guns/energy/pulse.dm
@@ -7,6 +7,7 @@
charge_cost = 200
projectile_type = "/obj/item/projectile/beam/pulse"
cell_type = "/obj/item/weapon/cell/super"
+ automatic = 1
var/mode = 2
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index 29c200bb8a0..740ba192209 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -13,6 +13,9 @@
/obj/item/weapon/gun/energy/taser/cyborg/load_into_chamber()//TOOD: change this over to the slowly recharge other cell
if(in_chamber)
+ if(!istype(in_chamber, projectile_type))
+ del(in_chamber)
+ in_chamber = new projectile_type(src)
return 1
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm
index 7d0912806d0..9f09417a9cb 100644
--- a/code/modules/projectiles/guns/projectile.dm
+++ b/code/modules/projectiles/guns/projectile.dm
@@ -6,7 +6,7 @@
origin_tech = "combat=2;materials=2"
w_class = 3.0
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
ammo_type = "/obj/item/ammo_casing/a357"
@@ -25,6 +25,7 @@
load_into_chamber()
+ if(in_chamber) return 1
if(!loaded.len) return 0
var/obj/item/ammo_casing/AC = loaded[1] //load next casing.
diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm
index 46086b8e48d..060c17718b4 100644
--- a/code/modules/projectiles/guns/projectile/automatic.dm
+++ b/code/modules/projectiles/guns/projectile/automatic.dm
@@ -7,6 +7,7 @@
caliber = "9mm"
origin_tech = "combat=4;materials=2"
ammo_type = "/obj/item/ammo_casing/c9mm"
+ automatic = 1
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 9248c85e34c..0849d9a63fe 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -55,6 +55,20 @@
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)
if(A == firer)
loc = A.loc
@@ -115,7 +129,7 @@
return 1
- process()
+ proc/fired()
spawn while(src)
if((!( current ) || loc == current))
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
@@ -130,3 +144,30 @@
Bump(M)
sleep(1)
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)
\ No newline at end of file
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index 477be0002a9..8e80b8a8024 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -9,7 +9,7 @@
var/ID = 0
var/main = 0
- process()
+ fired()
main = 1
ID = rand(0,1000)
var/first = 1
@@ -34,7 +34,6 @@
new_beam.icon_state = icon_state
else
first = 0
- processing_objects.Remove(src)
return
/obj/effect/effect/laserdealer
diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm
index bb8f30ad3ff..21c37156057 100644
--- a/code/modules/projectiles/projectile/energy.dm
+++ b/code/modules/projectiles/projectile/energy.dm
@@ -15,6 +15,12 @@
stutter = 10
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
name = "\improper Decloner Bolt"
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index a0310e86609..1284a73b06a 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -174,6 +174,8 @@
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))
return
+ if(!istype(target,/obj))
+ return
if(target.anchored)
return
if(target in user)
diff --git a/code/unused/hivebot/hud.dm b/code/unused/hivebot/hud.dm
index cc33795f10a..29414fb51b4 100644
--- a/code/unused/hivebot/hud.dm
+++ b/code/unused/hivebot/hud.dm
@@ -217,6 +217,7 @@
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
+ mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi'