Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes some Almayer Walls randomly changing icons when hit #4936

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,23 @@
/obj/structure/machinery/cm_vending/sorted/cargo_guns/cargo/blend,
)

/// The type of wall decoration we use, to avoid the wall changing icon all the time
var/decoration_type

/turf/closed/wall/almayer/Initialize(mapload, ...)
if(!special_icon && prob(20))
decoration_type = rand(0,3)
return ..()

/turf/closed/wall/almayer/update_icon()
..()
if(special_icon)
return
if(decoration_type == null)
return ..()
if(neighbors_list in list(EAST|WEST))
var/r1 = rand(0,10) //Make a random chance for this to happen
var/r2 = rand(0,3) // Which wall if we do choose it
if(r1 >= 9)
overlays += image(icon, icon_state = "almayer_deco_wall[r2]")
special_icon = TRUE
icon_state = "almayer_deco_wall[decoration_type]"
else // Wall connection was broken, return to normality
special_icon = FALSE
return ..()

/turf/closed/wall/almayer/take_damage(dam, mob/M)
var/damage_check = max(0, damage + dam)
Expand Down
Loading