Merge branch 'dev' into ofChemistryAndStuff

Conflicts:
	code/datums/recipe.dm
	code/game/machinery/bots/farmbot.dm
	code/game/machinery/bots/medbot.dm
	code/game/mecha/equipment/tools/tools.dm
	code/game/objects/effects/chem/chemsmoke.dm
	code/game/objects/effects/effect_system.dm
	code/game/objects/items/toys.dm
	code/game/objects/items/weapons/extinguisher.dm
	code/game/objects/items/weapons/mop.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/organs/organ_internal.dm
	code/modules/reagents/Chemistry-Holder.dm
	code/modules/reagents/Chemistry-Reagents.dm
	code/modules/reagents/Chemistry-Recipes.dm
	code/modules/reagents/reagent_containers/food/snacks.dm
	code/modules/reagents/reagent_containers/pill.dm
	code/modules/reagents/reagent_containers/spray.dm
	maps/exodus-1.dmm
This commit is contained in:
Kelenius
2015-04-28 10:49:26 +03:00
999 changed files with 26502 additions and 23206 deletions

View File

@@ -40,6 +40,10 @@
name = "magazine (.45 rubber)"
ammo_type = /obj/item/ammo_casing/c45r
/obj/item/ammo_magazine/c45m/practice
name = "magazine (.45 practice)"
ammo_type = /obj/item/ammo_casing/c45p
/obj/item/ammo_magazine/c45m/flash
name = "magazine (.45 flash)"
ammo_type = "/obj/item/ammo_casing/c45f"
@@ -90,6 +94,10 @@
name = "top mounted magazine (9mm rubber)"
ammo_type = /obj/item/ammo_casing/c9mmr
/obj/item/ammo_magazine/mc9mmt/practice
name = "top mounted magazine (9mm practice)"
ammo_type = /obj/item/ammo_casing/c9mmp
/obj/item/ammo_magazine/c45
name = "ammunition Box (.45)"
icon_state = "9mm"
@@ -130,6 +138,10 @@
/obj/item/ammo_magazine/a556/empty
initial_ammo = 0
/obj/item/ammo_magazine/a556/practice
name = "magazine (5.56mm practice)"
ammo_type = /obj/item/ammo_casing/a556p
/obj/item/ammo_magazine/a50
name = "magazine (.50)"
icon_state = "50ae"

View File

@@ -38,12 +38,22 @@
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/pistol/rubber
/obj/item/ammo_casing/c9mmp
desc = "A 9mm practice bullet casing."
caliber = "9mm"
projectile_type = /obj/item/projectile/bullet/pistol/practice
/obj/item/ammo_casing/c45
desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/item/projectile/bullet/pistol/medium
/obj/item/ammo_casing/c45p
desc = "A .45 practice bullet casing."
caliber = ".45"
projectile_type = /obj/item/projectile/bullet/pistol/practice
/obj/item/ammo_casing/c45r
desc = "A .45 rubber bullet casing."
caliber = ".45"
@@ -82,6 +92,13 @@
projectile_type = /obj/item/projectile/bullet/blank
matter = list("metal" = 90)
/obj/item/ammo_casing/shotgun/practice
name = "shotgun shell"
desc = "A practice shell."
icon_state = "pshell"
projectile_type = /obj/item/projectile/bullet/shotgun/practice
matter = list("metal" = 90)
/obj/item/ammo_casing/shotgun/beanbag
name = "beanbag shell"
desc = "A beanbag shell."
@@ -130,6 +147,11 @@
caliber = "a556"
projectile_type = /obj/item/projectile/bullet/rifle/a556
/obj/item/ammo_casing/a556p
desc = "A 5.56mm practice bullet casing."
caliber = "a556"
projectile_type = /obj/item/projectile/bullet/rifle/a556/practice
/obj/item/ammo_casing/rocket
name = "rocket shell"
desc = "A high explosive designed to be fired from a launcher."

View File

@@ -13,7 +13,7 @@
/obj/effect/projectile/proc/activate()
spawn(3)
delete() //see effect_system.dm - sets loc to null and lets GC handle removing these effects
qdel(src) //see effect_system.dm - sets loc to null and lets GC handle removing these effects
return
@@ -100,13 +100,13 @@
//----------------------------
/obj/effect/projectile/emitter/tracer
icon_state = "emitter"
/obj/effect/projectile/emitter/muzzle
icon_state = "muzzle_emitter"
/obj/effect/projectile/emitter/impact
icon_state = "impact_emitter"
//----------------------------
// Stun beam
//----------------------------

View File

@@ -4,8 +4,8 @@
desc = "Its a gun. It's pretty terrible, though."
icon = 'icons/obj/gun.dmi'
item_icons = list(
icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi',
)
icon_state = "detective"
item_state = "gun"
@@ -80,7 +80,7 @@
else
handle_click_empty(user)
return 0
return 1
return 1
/obj/item/weapon/gun/emp_act(severity)
for(var/obj/O in contents)
@@ -112,7 +112,7 @@
else if(user.a_intent == I_HURT) //point blank shooting
Fire(A, user, pointblank=1)
else
return ..() //Pistolwhippin'
return ..() //Pistolwhippin'
/obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, params, pointblank=0, reflex=0)
if(!user || !target) return
@@ -167,11 +167,19 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
user.visible_message(
"<span class='danger'>[user] fires [src][pointblank ? " point blank at [target]":""][reflex ? " by reflex":""]!</span>",
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>",
"You hear a [fire_sound_text]!"
)
if(reflex)
user.visible_message(
"<span class='reflex_shoot'><b>\The [user] fires \the [src][pointblank ? " point blank at \the [target]":""] by reflex!<b></span>",
"<span class='reflex_shoot'>You fire \the [src] by reflex!</span>",
"You hear a [fire_sound_text]!"
)
else
user.visible_message(
"<span class='danger'>\The [user] fires \the [src][pointblank ? " point blank at \the [target]":""]!</span>",
"<span class='warning'>You fire \the [src]!</span>",
"You hear a [fire_sound_text]!"
)
if(recoil)
spawn()
@@ -185,7 +193,7 @@
var/obj/item/projectile/P = projectile
//shooting while in shock
//shooting while in shock
var/x_offset = 0
var/y_offset = 0
if(istype(user, /mob/living/carbon))
@@ -252,13 +260,13 @@
else
user << "<span class = 'notice'>Ow...</span>"
user.apply_effect(110,AGONY,0)
del(in_chamber)
qdel(in_chamber)
mouthshoot = 0
return
else
handle_click_empty(user)
mouthshoot = 0
return
return
/obj/item/weapon/gun/proc/toggle_scope(var/zoom_amount=2.0)
//looking through a scope limits your periphereal vision

View File

@@ -20,7 +20,7 @@
processing_objects.Add(src)
last_regen = world.time
/obj/item/weapon/gun/launcher/spikethrower/Del()
/obj/item/weapon/gun/launcher/spikethrower/Destroy()
processing_objects.Remove(src)
..()

View File

@@ -31,7 +31,7 @@
processing_objects.Add(src)
update_icon()
/obj/item/weapon/gun/energy/Del()
/obj/item/weapon/gun/energy/Destroy()
if(self_recharge)
processing_objects.Remove(src)
..()

View File

@@ -2,7 +2,7 @@
name = "temperature gun"
icon_state = "freezegun"
fire_sound = 'sound/weapons/pulse3.ogg'
desc = "A gun that changes temperatures."
desc = "A gun that changes temperatures. It has a small label on the side, 'More extreme temperatures will cost more charge!'"
var/temperature = T20C
var/current_temperature = T20C
charge_cost = 100
@@ -10,7 +10,7 @@
slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/item/projectile/temp
cell_type = /obj/item/weapon/cell/crap
cell_type = /obj/item/weapon/cell/high
/obj/item/weapon/gun/energy/temperature/New()
@@ -18,7 +18,7 @@
processing_objects.Add(src)
/obj/item/weapon/gun/energy/temperature/Del()
/obj/item/weapon/gun/energy/temperature/Destroy()
processing_objects.Remove(src)
..()

View File

@@ -43,7 +43,7 @@
user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
var/obj/item/weapon/shard/shrapnel/S = new()
S.loc = get_turf(src)
src.Del()
qdel(src)
/obj/item/weapon/gun/launcher/crossbow
name = "powered crossbow"
@@ -257,7 +257,7 @@
if(buildstate == 5)
user << "\blue You secure the crossbow's various parts."
new /obj/item/weapon/gun/launcher/crossbow(get_turf(src))
del(src)
qdel(src)
return
else
..()

View File

@@ -150,7 +150,7 @@
if(istype(W,/obj/item/pipe))
if(buildstate == 0)
user.drop_item()
del(W)
qdel(W)
user << "\blue You secure the piping inside the frame."
buildstate++
update_icon()
@@ -168,7 +168,7 @@
else if(istype(W,/obj/item/device/transfer_valve))
if(buildstate == 4)
user.drop_item()
del(W)
qdel(W)
user << "\blue You install the transfer valve and connect it to the piping."
buildstate++
update_icon()
@@ -197,7 +197,7 @@
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "\blue You weld the valve into place."
new /obj/item/weapon/gun/launcher/pneumatic(get_turf(src))
del(src)
qdel(src)
return
else
..()

View File

@@ -62,7 +62,7 @@
/obj/item/weapon/gun/projectile/automatic/sts35/update_icon()
..()
icon_state = (ammo_magazine)? "arifle-0" : "arifle"
icon_state = (ammo_magazine)? "arifle" : "arifle-empty"
update_held_icon()
/obj/item/weapon/gun/projectile/automatic/wt550

View File

@@ -27,7 +27,7 @@
projectile_type = /obj/item/projectile/bullet/chemdart
/obj/item/ammo_casing/chemdart/expend()
del(src)
qdel(src)
/obj/item/ammo_magazine/chemdart
name = "dart cartridge"

View File

@@ -8,7 +8,7 @@
load_method = MAGAZINE
/obj/item/weapon/gun/projectile/colt/detective
desc = "A cheap Martian knock-off of a Colt M1911. Uses less-than-lethal .45 rounds."
desc = "A cheap Martian knock-off of a Colt M1911. Uses .45 rounds."
magazine_type = /obj/item/ammo_magazine/c45m/rubber
/obj/item/weapon/gun/projectile/colt/detective/verb/rename_gun()
@@ -30,7 +30,7 @@
return 1
/obj/item/weapon/gun/projectile/sec
desc = "A NanoTrasen designed sidearm, found pretty much everywhere humans are. Uses less-than-lethal .45 rounds."
desc = "A NanoTrasen designed sidearm, found pretty much everywhere humans are. Uses .45 rounds."
name = "\improper NT Mk58"
icon_state = "secguncomp"
magazine_type = /obj/item/ammo_magazine/c45m/rubber
@@ -40,11 +40,10 @@
/obj/item/weapon/gun/projectile/sec/flash
name = "\improper NT Mk58 signal pistol"
desc = "A NanoTrasen designed sidearm, found pretty much everywhere humans are. Uses .45 signal flash rounds."
magazine_type = /obj/item/ammo_magazine/c45m/flash
/obj/item/weapon/gun/projectile/sec/wood
desc = "A Nanotrasen designed sidearm, this one has a sweet wooden grip. Uses less-than-lethal .45 rounds."
desc = "A Nanotrasen designed sidearm, this one has a sweet wooden grip. Uses .45 rounds."
name = "\improper Custom NT Mk58"
icon_state = "secgundark"
@@ -118,7 +117,7 @@
/obj/item/weapon/gun/projectile/pistol/flash
name = "\improper Stechtkin signal pistol"
desc = "A small, easily concealable gun. Uses 9mm signal flash rounds."
desc = "A small, easily concealable gun. Uses 9mm rounds."
magazine_type = /obj/item/ammo_magazine/mc9mm/flash
/obj/item/weapon/gun/projectile/pistol/attack_hand(mob/user as mob)

View File

@@ -51,17 +51,18 @@
var/drowsy = 0
var/agony = 0
var/embed = 0 // whether or not the projectile can embed itself in the mob
var/hitscan = 0 // whether the projectile should be hitscan
var/hitscan = 0 // whether the projectile should be hitscan
var/step_delay = 1 // the delay between iterations if not a hitscan projectile
// effect types to be used
var/muzzle_type
var/tracer_type
var/impact_type
var/datum/plot_vector/trajectory // used to plot the path of the projectile
var/datum/vector_loc/location // current location of the projectile in pixel space
var/matrix/effect_transform // matrix to rotate and scale projectile effects - putting it here so it doesn't
var/matrix/effect_transform // matrix to rotate and scale projectile effects - putting it here so it doesn't
// have to be recreated multiple times
//TODO: make it so this is called more reliably, instead of sometimes by bullet_act() and sometimes not
@@ -113,12 +114,12 @@
if(user == target) //Shooting yourself
user.bullet_act(src, target_zone)
on_impact(user)
del(src)
qdel(src)
return 0
if(targloc == curloc) //Shooting something in the same turf
target.bullet_act(src, target_zone)
on_impact(target)
del(src)
qdel(src)
return 0
original = target
@@ -149,11 +150,13 @@
//Called when the projectile intercepts a mob. Returns 1 if the projectile hit the mob, 0 if it missed and should keep flying.
/obj/item/projectile/proc/attack_mob(var/mob/living/target_mob, var/distance, var/miss_modifier=0)
if(!istype(target_mob))
return
//accuracy bonus from aiming
if (istype(shot_from, /obj/item/weapon/gun))
var/obj/item/weapon/gun/daddy = shot_from
miss_modifier -= round(15*daddy.accuracy)
//If you aim at someone beforehead, it'll hit more often.
//Kinda balanced by fact you need like 2 seconds to aim
//As opposed to no-delay pew pew
@@ -197,7 +200,7 @@
/obj/item/projectile/Bump(atom/A as mob|obj|turf|area, forced=0)
if(A == src)
return 0 //no
if(A == firer)
loc = A.loc
return 0 //cannot shoot yourself
@@ -218,7 +221,7 @@
visible_message("<span class='danger'>\The [M] uses [G.affecting] as a shield!</span>")
if(Bump(G.affecting, forced=1))
return //If Bump() returns 0 (keep going) then we continue on to attack M.
passthrough = !attack_mob(M, distance)
else
passthrough = 1 //so ghosts don't stop bullets
@@ -227,7 +230,7 @@
if(isturf(A))
for(var/obj/O in A)
O.bullet_act(src)
for(var/mob/M in A)
for(var/mob/living/M in A)
attack_mob(M, distance)
//penetrating projectiles can pass through things that otherwise would not let them
@@ -250,11 +253,11 @@
//stop flying
on_impact(A)
density = 0
invisibility = 101
del(src)
qdel(src)
return 1
/obj/item/projectile/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -274,19 +277,22 @@
spawn while(src)
if(kill_count-- < 1)
on_impact(src.loc) //for any final impact behaviours
del(src)
qdel(src)
return
if((!( current ) || loc == current))
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
del(src)
qdel(src)
return
trajectory.increment() // increment the current location
location = trajectory.return_location(location) // update the locally stored location data
if(!location)
del(src) // if it's left the world... kill it
qdel(src) // if it's left the world... kill it
return
before_move()
Move(location.return_turf())
if(first_step)
@@ -294,20 +300,26 @@
first_step = 0
else
tracer_effect(effect_transform)
if(!bumped && !isturf(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original)
if(!hitscan)
sleep(1) //add delay between movement iterations if it's not a hitscan weapon
sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon
/obj/item/projectile/proc/process_step(first_step = 0)
/obj/item/projectile/proc/before_move()
/obj/item/projectile/proc/setup_trajectory()
// plot the initial trajectory
trajectory = new()
trajectory.setup(starting, original, pixel_x, pixel_y)
// generate this now since all visual effects the projectile makes can use it
effect_transform = new()
effect_transform.Scale(trajectory.return_hypotenuse(), 1)
@@ -319,7 +331,7 @@
if(ispath(muzzle_type))
var/obj/effect/projectile/M = new muzzle_type(get_turf(src))
if(istype(M))
M.set_transform(T)
M.pixel_x = location.pixel_x
@@ -329,7 +341,7 @@
/obj/item/projectile/proc/tracer_effect(var/matrix/M)
if(ispath(tracer_type))
var/obj/effect/projectile/P = new tracer_type(location.loc)
if(istype(P))
P.set_transform(M)
P.pixel_x = location.pixel_x
@@ -339,14 +351,14 @@
/obj/item/projectile/proc/impact_effect(var/matrix/M)
if(ispath(tracer_type))
var/obj/effect/projectile/P = new impact_type(location.loc)
if(istype(P))
P.set_transform(M)
P.pixel_x = location.pixel_x
P.pixel_y = location.pixel_y
P.activate()
//"Tracing" projectile
//"Tracing" projectile
/obj/item/projectile/test //Used to see if you can hit them.
invisibility = 101 //Nope! Can't see me!
yo = null
@@ -374,6 +386,8 @@
yo = targloc.y - curloc.y
xo = targloc.x - curloc.x
target = targloc
original = target
starting = curloc
//plot the initial trajectory
setup_trajectory()
@@ -407,5 +421,5 @@
trace.pass_flags = pass_flags //And the pass flags to that of the real projectile...
trace.firer = user
var/output = trace.process() //Test it!
del(trace) //No need for it anymore
return output //Send it back to the gun!
qdel(trace) //No need for it anymore
return output //Send it back to the gun!

View File

@@ -8,7 +8,7 @@
embed = 1
sharp = 1
var/mob_passthrough_check = 0
muzzle_type = /obj/effect/projectile/bullet/muzzle
/obj/item/projectile/bullet/on_hit(var/atom/target, var/blocked = 0)
@@ -38,8 +38,8 @@
if(ismob(A))
if(!mob_passthrough_check)
return 0
if(iscarbon(A))
damage *= 0.7 //squishy mobs absorb KE
if(iscarbon(A))
damage *= 0.7 //squishy mobs absorb KE
return 1
var/chance = 0
@@ -184,3 +184,15 @@
/obj/item/projectile/bullet/chameleon
damage = 1 // stop trying to murderbone with a fake gun dumbass!!!
embed = 0 // nope
/* Practice */
/obj/item/projectile/bullet/pistol/practice
damage = 5
/obj/item/projectile/bullet/rifle/a556/practice
damage = 5
/obj/item/projectile/bullet/shotgun/practice
name = "practice"
damage = 5

View File

@@ -19,11 +19,11 @@
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi)
del(Robot.mmi)
qdel(Robot.mmi)
else
for(var/obj/item/W in M)
if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something
del(W)
qdel(W)
continue
M.drop_from_inventory(W)
@@ -79,8 +79,8 @@
A.randomize_appearance_for(H)
if(new_mob)
for (var/obj/effect/proc_holder/spell/S in M.spell_list)
new_mob.spell_list += new S.type
for (var/spell/S in M.spell_list)
new_mob.add_spell(new S.type)
new_mob.a_intent = "hurt"
if(M.mind)
@@ -90,7 +90,7 @@
new_mob << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"
del(M)
qdel(M)
return
else
M << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"

View File

@@ -65,7 +65,7 @@
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))\
shake_camera(M, 3, 1)
del(src)
qdel(src)
return 1
else
return 0
@@ -141,12 +141,12 @@
/obj/item/projectile/icarus/pointdefense/process()
Icarus_FireLaser(get_turf(original))
spawn
del src
qdel(src)
return
/obj/item/projectile/icarus/guns/process()
Icarus_FireCannon(get_turf(original))
spawn
del src
qdel(src)
return

View File

@@ -14,7 +14,7 @@
set category = "Object"
if(aim_targets)
stop_aim()
usr.visible_message("\blue \The [usr] lowers \the [src]...")
usr.visible_message("<span class='notice'> \The [usr] lowers \the [src]...</span>")
//Clicking gun will still lower aim for guns that don't overwrite this
/obj/item/weapon/gun/attack_self()
@@ -23,7 +23,7 @@
//Removing the lock and the buttons.
/obj/item/weapon/gun/dropped(mob/user as mob)
stop_aim()
if (user.client)
if(user && user.client)
user.client.remove_gun_icons()
return ..()
@@ -40,14 +40,14 @@
for(var/mob/living/M in aim_targets)
if(M)
M.NotTargeted(src) //Untargeting people.
del(aim_targets)
qdel(aim_targets)
//Compute how to fire.....
//Return 1 if a target was found, 0 otherwise.
/obj/item/weapon/gun/proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params)
//Lets not spam it.
if(lock_time > world.time - 2) return
user.set_dir(get_cardinal_dir(src, A))
if(isliving(A) && !(A in aim_targets))
Aim(A) //Clicked a mob, aim at them
@@ -58,7 +58,7 @@
if(isliving(M) && (M in view(user)) && !(M in aim_targets))
Aim(M) //Aha! Aim at them!
return 1
return 0
//Aiming at the target mob.
@@ -69,10 +69,10 @@
for(var/mob/living/L in aim_targets)
if(L)
L.NotTargeted(src)
del(aim_targets)
usr.visible_message("\red <b>[usr] turns \the [src] on [M]!</b>")
qdel(aim_targets)
usr.visible_message("<span class='danger'><b>[usr] turns \the [src] on [M]!</b></span>")
else
usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>")
usr.visible_message("<span class='danger'><b>[usr] aims \a [src] at [M]!</b></span>")
M.Targeted(src)
//HE MOVED, SHOOT HIM!
@@ -83,19 +83,19 @@
if(src != M.get_active_hand())
stop_aim()
return
//reflex firing is disabled when help intent is set
if (M.a_intent == I_HELP)
M << "\red You refrain from firing your [src] as your intent is set to help."
M << "<span class='danger'>You refrain from firing your [src] as your intent is set to help.</span>"
return
M.last_move_intent = world.time
var/firing_check = can_hit(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, reflex = 1)
else if(!told_cant_shoot)
M << "\red They can't be hit from here!"
M << "<span class='danger'>They can't be hit from here!</span>"
told_cant_shoot = 1
spawn(30)
told_cant_shoot = 0
@@ -153,6 +153,7 @@
last_move_intent = -100
last_target_click = -5
target_locked = null
last_target_radio = -5;
/mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
if(!I.aim_targets)
@@ -171,10 +172,10 @@
if(!targeted_by) targeted_by = list()
targeted_by += I
I.lock_time = world.time + 20 //Target has 2 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 << "((<span class='danger'><b>Your character is being targeted. They have 2 seconds to stop any click or move actions.</b></span> While targeted, they may \
drag and drop items in or into the map, speak, and click on interface buttons. Clicking on the map objects (floors and walls are fine), 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 ))"
(other than a weapon to de-target), moving, or talking into a radio will result in being fired upon. <span class='danger'>The aggressor may also fire manually, \
so try not to get on their bad side.</span>))"
if(targeted_by.len == 1)
spawn(0)
@@ -194,8 +195,8 @@
else
I.lower_aim()
return
if(m_intent == "run" && 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.
if(iscarbon(src) && m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0)
src << "<span class='danger'>Your move intent is now set to walk, as your targeter permits it.</span>" //Self explanitory.
set_m_intent("walk")
//Processing the aiming. Should be probably in separate object with process() but lasy.
@@ -218,6 +219,12 @@
I.lock_time = world.time + 5
I.lock_time = world.time + 5
I.last_moved_mob = src
if(last_target_radio > I.lock_time + 10 && !T.client.target_can_radio)
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
sleep(1)
/mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I)
@@ -227,13 +234,13 @@
targeted_by -= I
I.aim_targets.Remove(src) //De-target them
if(!I.aim_targets.len)
del(I.aim_targets)
qdel(I.aim_targets)
var/mob/living/T = I.loc //Remove the targeting icons
if(T && ismob(T) && !I.aim_targets)
if(T && ismob(T) && !I.aim_targets && T.client)
T.client.remove_gun_icons()
if(!targeted_by.len)
del target_locked //Remove the overlay
del targeted_by
qdel(target_locked) //Remove the overlay
qdel(targeted_by)
spawn(1) update_targeted()
/mob/living/Move()
@@ -253,12 +260,14 @@
target_can_move = 0
target_can_run = 0
target_can_click = 0
target_can_radio = 0
gun_mode = 0
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
/client/proc/add_gun_icons()
screen += usr.item_use_icon
screen += usr.gun_move_icon
screen += usr.radio_use_icon
if (target_can_move)
screen += usr.gun_run_icon
@@ -268,6 +277,7 @@
if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG
screen -= usr.item_use_icon
screen -= usr.gun_move_icon
screen -= usr.radio_use_icon
if (target_can_move)
screen -= usr.gun_run_icon
@@ -298,7 +308,7 @@
else
usr << "Target may no longer move."
target_can_run = 0
del(usr.gun_run_icon) //no need for icon for running permission
qdel(usr.gun_run_icon) //no need for icon for running permission
//Updating walking permission button
if(usr.gun_move_icon)
@@ -313,10 +323,10 @@
if(target_can_move)
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 << "<span class='danger'>Your move intent is now set to walk, as your targeter permits it.</span>"
M.set_m_intent("walk")
else
M << "\red <b>Your character will now be shot if they move.</b>"
M << "<span class='danger'><b>Your character will now be shot if they move.</b></span>"
/mob/living/proc/set_m_intent(var/intent)
if (intent != "walk" && intent != "run")
@@ -349,7 +359,7 @@ client/verb/AllowTargetRun()
if(target_can_run)
M << "Your character may now <b>run</b> at the discretion of their targeter."
else
M << "\red <b>Your character will now be shot if they run.</b>"
M << "<span class='danger'><b>Your character will now be shot if they run.</b></span>"
/client/verb/AllowTargetClick()
set hidden=1
@@ -373,4 +383,27 @@ client/verb/AllowTargetRun()
if(target_can_click)
M << "Your character may now <b>use items</b> at the discretion of their targeter."
else
M << "\red <b>Your character will now be shot if they use items.</b>"
M << "<span class='danger'><b>Your character will now be shot if they use items.</b></span>"
/client/verb/AllowTargetRadio()
set hidden=1
target_can_radio = !target_can_radio
if(target_can_radio)
usr << "Target may now use radio."
else
usr << "Target may no longer use radio."
if(usr.radio_use_icon)
usr.radio_use_icon.icon_state = "no_radio[target_can_radio]"
usr.radio_use_icon.name = "[target_can_radio ? "Disallow" : "Allow"] Radio Use"
//Handling change for all the guns on client
for(var/obj/item/weapon/gun/G in src)
G.lock_time = world.time + 5
if(G.aim_targets)
for(var/mob/living/M in G.aim_targets)
if(target_can_radio)
M << "Your character may now <b>use the radio</b> at the discretion of their targeter."
else
M << "<span class='danger'><b>Your character will now be shot if they use the radio.</b></span>"