the old system isnt needed really but sure i guess

This commit is contained in:
Timothy Teakettle
2020-08-04 11:43:15 +01:00
parent 91664f5064
commit ef53f3faea
7 changed files with 25 additions and 6 deletions
+9
View File
@@ -1,3 +1,12 @@
/// This atom should be ricocheted off of from its inherent properties using standard % chance handling.
#define PROJECTILE_RICOCHET_YES 1
/// This atom should not be ricocheted off of from its inherent properties.
#define PROJECTILE_RICOCHET_NO 2
/// This atom should prevent any kind of projectile ricochet from its inherent properties.
#define PROJECTILE_RICOCHET_PREVENT 3
/// This atom should force a projectile ricochet from its inherent properties.
#define PROJECTILE_RICOCHET_FORCE 4
//bullet_act() return values
#define BULLET_ACT_HIT "HIT" //It's a successful hit, whatever that means in the context of the thing it's hitting.
#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
+7
View File
@@ -156,6 +156,13 @@
return ..()
/**
* Checks if a projectile should ricochet off of us. Projectiles get final say.
* [__DEFINES/projectiles.dm] for return values.
*/
/atom/proc/check_projectile_ricochet(obj/item/projectile/P)
return (flags_1 & DEFAULT_RICOCHET_1)? PROJECTILE_RICOCHET_YES : PROJECTILE_RICOCHET_NO
/atom/proc/handle_ricochet(obj/item/projectile/P)
var/turf/p_turf = get_turf(P)
var/face_direction = get_dir(src, p_turf)
+4 -2
View File
@@ -9,8 +9,10 @@
var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN
layer = BELOW_OBJ_LAYER
flags_ricochet = RICOCHET_HARD
ricochet_chance_mod = 0.5
//ricochets on structures commented out for now because there's a lot of structures that /shouldnt/ be ricocheting and those need to be reviewed first
//flags_1 = DEFAULT_RICOCHET_1
//flags_ricochet = RICOCHET_HARD
//ricochet_chance_mod = 0.5
/obj/structure/Initialize()
if (!armor)
+2 -2
View File
@@ -17,7 +17,6 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
layer = ABOVE_OBJ_LAYER //Just above doors
pressure_resistance = 4*ONE_ATMOSPHERE
anchored = TRUE //initially is 0 for tile smoothing
flags_1 = ON_BORDER_1
max_integrity = 25
var/ini_dir = null
var/state = WINDOW_OUT_OF_FRAME
@@ -38,7 +37,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
var/hitsound = 'sound/effects/Glasshit.ogg'
rad_insulation = RAD_VERY_LIGHT_INSULATION
rad_flags = RAD_PROTECT_CONTENTS
flags_ricochet = RICOCHET_HARD
flags_1 = ON_BORDER_1|DEFAULT_RICOCHET_1
flags_ricochet = RICOCHET_HARD
ricochet_chance_mod = 0.4
attack_hand_speed = CLICK_CD_MELEE
attack_hand_is_action = TRUE
@@ -191,7 +191,7 @@
icon = 'icons/turf/walls/shuttle_wall.dmi'
icon_state = "map-shuttle"
explosion_block = 3
flags_1 = CAN_BE_DIRTY_1
flags_1 = CAN_BE_DIRTY_1 | DEFAULT_RICOCHET_1
flags_ricochet = RICOCHET_SHINY | RICOCHET_HARD
sheet_type = /obj/item/stack/sheet/mineral/titanium
smooth = SMOOTH_MORE|SMOOTH_DIAGONAL
+1
View File
@@ -6,6 +6,7 @@
icon = 'icons/turf/walls/wall.dmi'
icon_state = "wall"
explosion_block = 1
flags_1 = DEFAULT_RICOCHET_1
flags_ricochet = RICOCHET_HARD
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall
+1 -1
View File
@@ -316,7 +316,7 @@
if(!trajectory)
return
var/turf/T = get_turf(A)
if(check_ricochet(A) && check_ricochet_flag(A)) //if you can ricochet, attempt to ricochet off the object
if(A.check_projectile_ricochet(src) && check_ricochet_flag(A) && check_ricochet(A)) //if you can ricochet, attempt to ricochet off the object
ricochets++
if(A.handle_ricochet(src))
on_ricochet(A) //if allowed, use autoaim to ricochet into someone, otherwise default to ricocheting off the object from above