Skip to content

Commit

Permalink
Baton slug and timestamp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jul 27, 2023
1 parent ed2c5c5 commit 07560cd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
33 changes: 17 additions & 16 deletions code/game/objects/items/explosives/grenades/marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -547,31 +547,32 @@
ram_distance -- //for max pinballing.
icon_state = inactive_icon

/obj/item/explosive/grenade/slug/proc/impact_mob(mob/living/M)
var/direction = Get_Angle(src,M)
var/target_turf = get_angle_target_turf(src,direction,throw_max)
var/fling = rand(throw_min,throw_max) //WEEEEEEEEEEEEEEEEEEEE What is going to be put into throw_atom
/obj/item/explosive/grenade/slug/proc/impact_mob(mob/living/smacked)
var/direction = Get_Angle(src, smacked)
var/target_turf = get_angle_target_turf(src,direction, throw_max)
var/fling = rand(throw_min, throw_max) //WEEEEEEEEEEEEEEEEEEEE What is going to be put into throw_atom
var/random_tile = 0 //random tile for bounce

playsound(M.loc, impact_sound, 75, 1)
M.apply_damage(impact_damage, BRUTE)
playsound(smacked.loc, impact_sound, 75, 1)
smacked.apply_damage(impact_damage, BRUTE)
smacked.attack_log += "[\[time_stamp()]\] [src], fired by [fingerprintslast], struck [key_name(smacked)]."

Check failure on line 558 in code/game/objects/items/explosives/grenades/marines.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got 'time_stamp', expected one of: operator, term, ']'

random_tile = get_random_turf_in_range(src,ram_distance,ram_distance) //getting random tile for bounce
src.throw_atom(random_tile,ram_distance,SPEED_FAST,src,TRUE,NORMAL_LAUNCH,NO_FLAGS) //time for a little trolling

if(isyautja(M)|| issynth(M))
M.apply_effect(slowdown_time * 0.5, SLOW)
M.apply_effect(dazed_time * 0.5, DAZE)
if(isyautja(smacked)|| issynth(smacked))
smacked.apply_effect(slowdown_time * 0.5, SLOW)
smacked.apply_effect(dazed_time * 0.5, DAZE)

if(M.mob_size >= MOB_SIZE_BIG)//big xenos not KO'ed
M.apply_effect(slowdown_time * 1.2, SLOW)//They are slowed more :trol:
M.apply_effect(dazed_time * 1.2, DAZE)
if(smacked.mob_size >= MOB_SIZE_BIG)//big xenos not KO'ed
smacked.apply_effect(slowdown_time * 1.2, SLOW)//They are slowed more :trol:
smacked.apply_effect(dazed_time * 1.2, DAZE)
return

M.apply_effect(knockout_time, WEAKEN)//but little xenos and humans are
M.throw_atom(target_turf,fling,SPEED_AVERAGE,M,TRUE)
M.apply_effect(slowdown_time, SLOW)
M.apply_effect(dazed_time, DAZE)
smacked.apply_effect(knockout_time, WEAKEN)//but little xenos and humans are
smacked.throw_atom(target_turf, fling, SPEED_AVERAGE, smacked, TRUE)
smacked.apply_effect(slowdown_time, SLOW)
smacked.apply_effect(dazed_time, DAZE)
return

/obj/item/explosive/grenade/slug/baton
Expand Down
21 changes: 11 additions & 10 deletions code/modules/projectiles/guns/specialist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -829,26 +829,27 @@
muzzle_flash(angle,user)
simulate_recoil(0, user)

var/obj/item/explosive/grenade/F = cylinder.contents[1]
cylinder.remove_from_storage(F, user.loc)
var/obj/item/explosive/grenade/fired = cylinder.contents[1]
cylinder.remove_from_storage(fired, user.loc)
var/pass_flags = NO_FLAGS
if(is_lobbing)
if(istype(F, /obj/item/explosive/grenade/slug/baton))
if(istype(fired, /obj/item/explosive/grenade/slug/baton))
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
human_user.remember_dropped_object(F)
human_user.remember_dropped_object(fired)
fired.fingerprintslast = key_name(user)
pass_flags |= PASS_MOB_THRU_HUMAN|PASS_MOB_IS_OTHER|PASS_OVER
else
pass_flags |= PASS_MOB_THRU|PASS_HIGH_OVER

msg_admin_attack("[key_name_admin(user)] fired a grenade ([F.name]) from \a ([name]).")
msg_admin_attack("[key_name_admin(user)] fired a grenade ([fired.name]) from \a ([name]).")
log_game("[key_name_admin(user)] used a grenade ([name]).")

F.throw_range = 20
F.det_time = min(10, F.det_time)
F.activate(user, FALSE)
F.forceMove(get_turf(src))
F.throw_atom(target, 20, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags)
fired.throw_range = 20
fired.det_time = min(10, fired.det_time)
fired.activate(user, FALSE)
fired.forceMove(get_turf(src))
fired.throw_atom(target, 20, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags)



Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@

var/mob/living/carbon/shotby = firer
if(istype(shotby))
L.attack_log += "[time_stamp()]\] [src], fired by [key_name(firer)], narrowly missed [key_name(L)]"
shotby.attack_log += "[time_stamp()]\] [src], fired by [key_name(shotby)], narrowly missed [key_name(L)]"
L.attack_log += "[\[time_stamp()]\] [src], fired by [key_name(firer)], narrowly missed [key_name(L)]"

Check failure on line 508 in code/modules/projectiles/projectile.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got 'time_stamp', expected one of: operator, term, ']'
shotby.attack_log += "[\[time_stamp()]\] [src], fired by [key_name(shotby)], narrowly missed [key_name(L)]"
log_message = "[src], fired by [key_name(firer)], narrowly missed [key_name(L)]"
log_attack(log_message)

Expand Down

0 comments on commit 07560cd

Please sign in to comment.