mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
Merge pull request #2389 from comma/bleeding-edge-freeze
Guns, medicine and fixes.
This commit is contained in:
@@ -134,7 +134,7 @@ proc/hasorgans(A)
|
||||
zone = "head"
|
||||
if("mouth")
|
||||
zone = "head"
|
||||
if("l_hand")
|
||||
/* if("l_hand")
|
||||
zone = "l_arm"
|
||||
if("r_hand")
|
||||
zone = "r_arm"
|
||||
@@ -144,6 +144,7 @@ proc/hasorgans(A)
|
||||
zone = "r_leg"
|
||||
if("groin")
|
||||
zone = "chest"
|
||||
*/
|
||||
return zone
|
||||
|
||||
|
||||
@@ -171,7 +172,7 @@ proc/hasorgans(A)
|
||||
|
||||
// you can only miss if your target is standing and not restrained
|
||||
if(!target.buckled && !target.lying)
|
||||
var/miss_chance = max(10 + miss_chance_mod, 0)
|
||||
var/miss_chance = 10
|
||||
switch(zone)
|
||||
if("head")
|
||||
miss_chance = 40
|
||||
@@ -191,6 +192,7 @@ proc/hasorgans(A)
|
||||
miss_chance = 50
|
||||
if("r_foot")
|
||||
miss_chance = 50
|
||||
miss_chance = max(miss_chance + miss_chance_mod, 0)
|
||||
if(prob(miss_chance))
|
||||
if(prob(70))
|
||||
return null
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#define SPEEDLOADER 0
|
||||
#define FROM_BOX 1
|
||||
#define MAGAZINE 2
|
||||
|
||||
/obj/item/weapon/gun/projectile
|
||||
desc = "A classic revolver. Uses 357 ammo"
|
||||
name = "revolver"
|
||||
@@ -10,7 +14,7 @@
|
||||
var/ammo_type = "/obj/item/ammo_casing/a357"
|
||||
var/list/loaded = list()
|
||||
var/max_shells = 7
|
||||
var/load_method = 0 //0 = Single shells or quick loader, 1 = box, 2 = magazine
|
||||
var/load_method = SPEEDLOADER //0 = Single shells or quick loader, 1 = box, 2 = magazine
|
||||
var/obj/item/ammo_magazine/empty_mag = null
|
||||
|
||||
|
||||
@@ -45,7 +49,7 @@
|
||||
|
||||
var/num_loaded = 0
|
||||
if(istype(A, /obj/item/ammo_magazine))
|
||||
if((load_method == 2) && loaded.len) return
|
||||
if((load_method == MAGAZINE) && loaded.len) return
|
||||
var/obj/item/ammo_magazine/AM = A
|
||||
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
|
||||
if(loaded.len >= max_shells)
|
||||
@@ -55,11 +59,11 @@
|
||||
AM.stored_ammo -= AC
|
||||
loaded += AC
|
||||
num_loaded++
|
||||
if(load_method == 2)
|
||||
if(load_method == MAGAZINE)
|
||||
user.remove_from_mob(AM)
|
||||
empty_mag = AM
|
||||
empty_mag.loc = src
|
||||
if(istype(A, /obj/item/ammo_casing) && !load_method)
|
||||
if(istype(A, /obj/item/ammo_casing) && load_method == SPEEDLOADER)
|
||||
var/obj/item/ammo_casing/AC = A
|
||||
if(AC.caliber == caliber && loaded.len < max_shells)
|
||||
user.drop_item()
|
||||
@@ -72,6 +76,25 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/attack_self(mob/user as mob)
|
||||
if (loaded.len)
|
||||
if (load_method == SPEEDLOADER)
|
||||
var/obj/item/ammo_casing/AC = loaded[1]
|
||||
loaded -= AC
|
||||
AC.loc = get_turf(src) //Eject casing onto ground.
|
||||
user << "\blue You unload shell from \the [src]!"
|
||||
if (load_method == MAGAZINE)
|
||||
var/obj/item/ammo_magazine/AM = empty_mag
|
||||
for (var/obj/item/ammo_casing/AC in loaded)
|
||||
AM.stored_ammo += AC
|
||||
loaded -= AC
|
||||
AM.loc = get_turf(src)
|
||||
empty_mag = null
|
||||
user << "\blue You unload magazine from \the [src]!"
|
||||
else
|
||||
user << "\red Nothing loaded in \the [src]!"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/examine()
|
||||
..()
|
||||
|
||||
@@ -74,37 +74,34 @@
|
||||
loc = A.loc
|
||||
return 0// nope.avi
|
||||
|
||||
var/distance = get_dist(original,loc)
|
||||
var/distance = get_dist(starting,loc)
|
||||
//Lower accurancy/longer range tradeoff. Distance matters a lot here, so at
|
||||
// close distance, actually RAISE the chance to hit.
|
||||
def_zone = get_zone_with_miss_chance(def_zone, M, -30 + 8*distance)
|
||||
|
||||
if(silenced)
|
||||
if(def_zone)
|
||||
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
|
||||
if(!def_zone)
|
||||
visible_message("\blue \The [src] misses [M] narrowly!")
|
||||
forcedodge = -1
|
||||
else
|
||||
if(!def_zone)
|
||||
visible_message("\The [src] misses [M] narrowly.")
|
||||
del(src)
|
||||
return
|
||||
if(silenced)
|
||||
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
|
||||
else
|
||||
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
|
||||
if(istype(firer, /mob))
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
else
|
||||
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
if(istype(firer, /mob))
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
else
|
||||
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
msg_admin_attack("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
|
||||
spawn(0)
|
||||
if(A)
|
||||
var/permutation = A.bullet_act(src, def_zone) // searches for return value
|
||||
if(permutation == -1 || forcedodge) // the bullet passes through a dense object!
|
||||
if (!forcedodge)
|
||||
forcedodge = A.bullet_act(src, def_zone) // searches for return value
|
||||
if(forcedodge == -1) // the bullet passes through a dense object!
|
||||
bumped = 0 // reset bumped variable!
|
||||
if(istype(A, /turf))
|
||||
loc = A
|
||||
@@ -118,7 +115,6 @@
|
||||
O.bullet_act(src)
|
||||
for(var/mob/M in A)
|
||||
M.bullet_act(src, def_zone)
|
||||
|
||||
density = 0
|
||||
invisibility = 101
|
||||
del(src)
|
||||
|
||||
@@ -20,50 +20,56 @@ var/list/beam_master = list()
|
||||
process()
|
||||
var/reference = "\ref[src]" //So we do not have to recalculate it a ton
|
||||
var/first = 1 //So we don't make the overlay in the same tile as the firer
|
||||
spawn while(src) //Move until we hit something
|
||||
|
||||
spawn(0)
|
||||
while(!bumped) //Move until we hit something
|
||||
step_towards(src, current) //Move~
|
||||
if((!( current ) || loc == current)) //If we pass our target
|
||||
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) //Delete if it passes the world edge
|
||||
return
|
||||
step_towards(src, current) //Move~
|
||||
|
||||
for(var/mob/living/M in loc)
|
||||
Bump(M) //Bump anyone we touch
|
||||
if(kill_count < 1)
|
||||
del(src)
|
||||
kill_count--
|
||||
|
||||
if((!( current ) || loc == current)) //If we pass our target
|
||||
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
|
||||
if(!bumped && !isturf(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Bump(original)
|
||||
|
||||
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
|
||||
del(src) //Delete if it passes the world edge
|
||||
return
|
||||
if(!first) //Add the overlay as we pass over tiles
|
||||
var/target_dir = get_dir(src, current) //So we don't call this too much
|
||||
|
||||
if(!first) //Add the overlay as we pass over tiles
|
||||
var/target_dir = get_dir(src, current) //So we don't call this too much
|
||||
//If the icon has not been added yet
|
||||
if( !("[icon_state][target_dir]" in beam_master) )
|
||||
var/image/I = image(icon,icon_state,10,target_dir) //Generate it.
|
||||
beam_master["[icon_state][target_dir]"] = I //And cache it!
|
||||
|
||||
//If the icon has not been added yet
|
||||
if( !("[icon_state][target_dir]" in beam_master) )
|
||||
var/image/I = image(icon,icon_state,10,target_dir) //Generate it.
|
||||
beam_master["[icon_state][target_dir]"] = I //And cache it!
|
||||
//Finally add the overlay
|
||||
src.loc.overlays += beam_master["[icon_state][target_dir]"]
|
||||
|
||||
//Finally add the overlay
|
||||
src.loc.overlays += beam_master["[icon_state][target_dir]"]
|
||||
|
||||
//Add the turf to a list in the beam master so they can be cleaned up easily.
|
||||
if(reference in beam_master)
|
||||
var/list/turf_master = beam_master[reference]
|
||||
if("[icon_state][target_dir]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state][target_dir]"]
|
||||
turfs += loc
|
||||
else
|
||||
turf_master["[icon_state][target_dir]"] = list(loc)
|
||||
//Add the turf to a list in the beam master so they can be cleaned up easily.
|
||||
if(reference in beam_master)
|
||||
var/list/turf_master = beam_master[reference]
|
||||
if("[icon_state][target_dir]" in turf_master)
|
||||
var/list/turfs = turf_master["[icon_state][target_dir]"]
|
||||
turfs += loc
|
||||
else
|
||||
var/list/turfs = list()
|
||||
turfs["[icon_state][target_dir]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
turf_master["[icon_state][target_dir]"] = list(loc)
|
||||
else
|
||||
first = 0
|
||||
|
||||
var/list/turfs = list()
|
||||
turfs["[icon_state][target_dir]"] = list(loc)
|
||||
beam_master[reference] = turfs
|
||||
else
|
||||
first = 0
|
||||
cleanup(reference)
|
||||
return
|
||||
|
||||
Del()
|
||||
cleanup("\ref[src]")
|
||||
..()
|
||||
|
||||
proc/cleanup(reference) //Waits .3 seconds then removes the overlay.
|
||||
src = null
|
||||
sleep(3)
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
/datum/surgery_step/generic/retract_skin
|
||||
required_tool = /obj/item/weapon/retractor
|
||||
allowed_tools = list(/obj/item/weapon/kitchen/utensil/fork)
|
||||
allowed_tools = list(/obj/item/weapon/crowbar,/obj/item/weapon/kitchen/utensil/fork)
|
||||
|
||||
min_duration = 30
|
||||
max_duration = 40
|
||||
|
||||
Reference in New Issue
Block a user