Skip to content

Commit

Permalink
fixes some bugs (#6679)
Browse files Browse the repository at this point in the history
- syringes & blood
- turrets
- a cargo voucher
  • Loading branch information
silicons authored Aug 30, 2024
1 parent dd97a3d commit d00b4e6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions code/game/click/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
// - item use & receive item use (item_interaction() on /atom, definiteily)
// - tool use & receive tool use (we already have tool_interaction() on /atom)
// - melee attack & receive melee attack (melee_interaction() on /atom? not melee_act directly?)
// - melee attack shouldn't require attackby() to allow it to, it should be automatic on harm intent (?)
// - the item should have final say but we need a way to allow click redirections so..
if(resolve_attackby(target, user, params, null, .))
return CLICKCHAIN_DO_NOT_PROPAGATE
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/turrets/turret-ai_holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
set_ticking(idle_retarget_pulse_time)

/datum/ai_holder/turret/tick(cycles)
var/obj/machinery/porta_turret/turret = agent
// check if we should do anything
if(turret.disabled || !turret.enabled)
idle()
return
// first, evaluate
var/found_in_wake_range = continuous_evaluation()
// then,
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/turrets/turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@
else
to_chat(user, "<span class='notice'>Access denied.</span>")

..()
else
return ..()

/obj/machinery/porta_turret/emag_act(remaining_charges, mob/user)
if(!emagged)
Expand Down Expand Up @@ -574,7 +575,7 @@
if(assess_perp(L) < 4)
return TURRET_NOT_TARGET //if threat level < 4, keep going

if(L.stat != CONSCIOUS) //if the perp is lying down, it's still a target but a less-important target
if(L.stat != CONSCIOUS && (lethal || emagged)) //if the perp is lying down, it's still a target but a less-important target
return check_down ? TURRET_SECONDARY_TARGET : TURRET_NOT_TARGET

return TURRET_PRIORITY_TARGET //if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee
Expand Down Expand Up @@ -648,7 +649,7 @@
* @return TRUE on success
*/
/obj/machinery/porta_turret/proc/try_fire_at(atom/target, angle)
if(disabled || is_integrity_broken())
if(disabled || !enabled || is_integrity_broken())
return FALSE
if(is_on_cooldown())
return FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
order.comment = "Voucher redemption"
order.ordered_at = stationdate2text() + " - " + stationtime2text()
order.status = SUP_ORDER_APPROVED //auto approved
order.approved_by = "[src]"
order.approved_by = "[user]"
order.approved_at = stationdate2text() + " - " + stationtime2text()

SSsupply.order_history += order//tell supply the order exists.
Expand Down Expand Up @@ -224,7 +224,7 @@
name = "Laser reflector voucher"
desc = "A voucher redeemable, at any NT cargo department, for a single laser reflector."
icon_state = "engineering_voucher"
redeemable_for = new /datum/supply_pack/nanotrasen/engineering/engine/fusion_fuel_compressor
redeemable_for = new /datum/supply_pack/nanotrasen/engineering/reflector

/obj/item/engineering_mystical_tech
name = "XYE"
Expand Down
11 changes: 7 additions & 4 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,13 @@
if(trajectory_moving_to)
// create tracers
var/datum/point/visual_impact_point = get_intersection_point(trajectory_moving_to)
// kick it forwards a bit
visual_impact_point.shift_in_projectile_angle(angle, 2)
// draw
finalize_hitscan_tracers(visual_impact_point, impact_effect = TRUE)
if(visual_impact_point)
// kick it forwards a bit
visual_impact_point.shift_in_projectile_angle(angle, 2)
// draw
finalize_hitscan_tracers(visual_impact_point, impact_effect = TRUE)
else
finalize_hitscan_tracers(impact_effect = TRUE, kick_forwards = 32)
else
finalize_hitscan_tracers(impact_effect = TRUE, kick_forwards = 32)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reagent_containers/syringes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
B = T.take_blood(src,amount)
drawing = 0

if (B)
if (B && !(B in reagents.reagent_list))
reagents.reagent_list += B
reagents.update_total()
on_reagent_change()
Expand Down

0 comments on commit d00b4e6

Please sign in to comment.