Files
Bubberstation/code/game/objects/structures.dm
necromanceranne 0eaf4ca0df Various Antagonist Handgun/Rifle changes; Stechkin, Stechkin APS, c20-r, m90gl (#50734)
* overhauls the crap out of a lot of antag guns and their ammo

* Should probably shoot an additional bullet per squeeze at this point

* nyoops

* So travis will stop yelling at me for new lines

* Should be all I need to fix for maps

* Touches up the stechkin sprite again

* Increased the fire rate and spread of the APS and the spread of the m90, added additional magazine types for the APS and added incendiary mags into the Spetznaz bundle to retain the fire theme, added phasic m90 ammo that penetrates through all surfaces but does significantly less damage available to ops for 8 tc, tided up the code for the aps a little more and also it's sprite.

* fixes some stuff

* So travis will cease screaming

* Changed how the phasic bullets work to being closer to xray beams, added additional flags to allow the bullets to pass through structures and machinery

* Update code/game/machinery/_machinery.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* Update code/game/machinery/_machinery.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* Update code/game/machinery/doors/door.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* Update code/modules/projectiles/boxes_magazines/external/pistol.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* Update code/game/objects/structures.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* updated the gun sprites a bit more

* Hopefully this fixes the conflicts?

* Update code/game/machinery/doors/door.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

* More updating, fatter stechkin sprite

Co-authored-by: Rohesie <rohesie@gmail.com>
2020-05-04 06:21:14 -03:00

132 lines
4.1 KiB
Plaintext

/obj/structure
icon = 'icons/obj/structures.dmi'
pressure_resistance = 8
max_integrity = 300
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT
layer = BELOW_OBJ_LAYER
flags_ricochet = RICOCHET_HARD
ricochet_chance_mod = 0.5
var/climb_time = 20
var/climb_stun = 20
var/climbable = FALSE
var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN
/obj/structure/Initialize()
if (!armor)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
. = ..()
if(smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
icon_state = ""
GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy()
GLOB.cameranet.updateVisibility(src)
if(smooth)
queue_smooth_neighbors(src)
return ..()
/obj/structure/attack_hand(mob/user)
. = ..()
if(.)
return
if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
structureclimber.Paralyze(40)
structureclimber.visible_message("<span class='warning'>[structureclimber] is knocked off [src].</span>", "<span class='warning'>You're knocked off [src]!</span>", "<span class='warning'>You see [structureclimber] get knocked off [src].</span>")
/obj/structure/ui_act(action, params)
. = ..()
add_fingerprint(usr)
/obj/structure/MouseDrop_T(atom/movable/O, mob/user)
. = ..()
if(!climbable)
return
if(user == O && isliving(O))
var/mob/living/L = O
if(isanimal(L))
var/mob/living/simple_animal/A = L
if (!A.dextrous)
return
if(L.mobility_flags & MOBILITY_MOVE)
climb_structure(user)
return
if(!istype(O, /obj/item) || user.get_active_held_item() != O)
return
if(iscyborg(user))
return
if(!user.dropItemToGround(O))
return
if (O.loc != src.loc)
step(O, get_dir(O, src))
/obj/structure/proc/do_climb(atom/movable/A)
if(climbable)
if(A.loc == src.loc)
var/where_to_climb = get_step(A,dir)
if(!(is_blocked_turf(where_to_climb)))
A.forceMove(where_to_climb)
return TRUE
density = FALSE
. = step(A,get_dir(A,src.loc))
density = TRUE
/obj/structure/proc/climb_structure(mob/living/user)
src.add_fingerprint(user)
user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \
"<span class='notice'>You start climbing onto [src]...</span>")
var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2
if(isalien(user))
adjusted_climb_time *= 0.25 //aliens are terrifyingly fast
if(HAS_TRAIT(user, TRAIT_FREERUNNING)) //do you have any idea how fast I am???
adjusted_climb_time *= 0.8
structureclimber = user
if(do_mob(user, user, adjusted_climb_time))
if(src.loc) //Checking if structure has been destroyed
if(do_climb(user))
user.visible_message("<span class='warning'>[user] climbs onto [src].</span>", \
"<span class='notice'>You climb onto [src].</span>")
log_combat(user, src, "climbed onto")
if(climb_stun)
user.Stun(climb_stun)
. = 1
else
to_chat(user, "<span class='warning'>You fail to climb onto [src].</span>")
structureclimber = null
/obj/structure/examine(mob/user)
. = ..()
if(!(resistance_flags & INDESTRUCTIBLE))
if(resistance_flags & ON_FIRE)
. += "<span class='warning'>It's on fire!</span>"
if(broken)
. += "<span class='notice'>It appears to be broken.</span>"
var/examine_status = examine_status(user)
if(examine_status)
. += examine_status
/obj/structure/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(mover.pass_flags & PASSSTRUCTURE)
return TRUE
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (obj_integrity/max_integrity) * 100
switch(healthpercent)
if(50 to 99)
return "It looks slightly damaged."
if(25 to 50)
return "It appears heavily damaged."
if(0 to 25)
if(!broken)
return "<span class='warning'>It's falling apart!</span>"