mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Ports Malf AI rolling (and some other tipping refactors) (#21900)
* some thoughts * I really forgot to commit all of this didn't I * Rework vendor crits * fixes some angle jank * yeag * Patches up most bugs with tilting things over * Fixes up most of the AI logic * rolling AI can now take teleporters, visual effect is now only seen by the AI * better effects * Remove a bunch of now useless code * I keep forgetting this * cleanup in aisle seven * oops * some more testing * adminbus hours * Fixes some buildmode stuff, does some more testing * Add documentation * Demo bugs * Apply suggestions from code review Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * rework crit damage amount * Adapt recent tg changes * Fix some small bugs in testing, contra review 1 * contra review 2 * Fixes tipping with pacifism * restore removed icons * Fix some remote untipping * restore the roll action * finally address contra's review (sorry) * remove debug tool * Move untilt logic into component --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
@@ -399,6 +399,77 @@
|
||||
icon_state = "rcd_short_reverse"
|
||||
duration = 3.1 SECONDS
|
||||
|
||||
/**
|
||||
* A visual effect that will be shown only to a particular user for a period of time.
|
||||
*/
|
||||
/obj/effect/temp_visual/single_user
|
||||
/// The image to show to the user
|
||||
var/image/displayed_image
|
||||
/// The UID of the person who the image is being displayed to
|
||||
var/source_UID
|
||||
/// The real icon state to be applied to the image
|
||||
var/image_icon_state
|
||||
/// The plane to apply the image to
|
||||
var/image_plane = ABOVE_LIGHTING_PLANE
|
||||
/// The layer to apply the image to
|
||||
var/image_layer = ABOVE_ALL_MOB_LAYER
|
||||
/// The icon to pull the image from
|
||||
var/image_icon
|
||||
|
||||
|
||||
/obj/effect/temp_visual/single_user/Initialize(mapload, mob/living/user)
|
||||
. = ..()
|
||||
if(!user)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
displayed_image = create_image(user)
|
||||
displayed_image.plane = image_plane
|
||||
displayed_image.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
source_UID = user.UID()
|
||||
add_mind(user)
|
||||
|
||||
|
||||
/obj/effect/temp_visual/single_user/proc/create_image(mob/living/looker)
|
||||
return image(icon = image_icon, loc = src, icon_state = image_icon_state, layer = image_layer)
|
||||
|
||||
|
||||
/obj/effect/temp_visual/single_user/Destroy()
|
||||
var/mob/living/previous_user = locateUID(source_UID)
|
||||
if(previous_user)
|
||||
remove_mind(previous_user)
|
||||
// Null so we don't shit the bed when we delete
|
||||
displayed_image = null
|
||||
return ..()
|
||||
|
||||
/// Add the image to the user's screen
|
||||
/obj/effect/temp_visual/single_user/proc/add_mind(mob/living/looker)
|
||||
looker.client?.images |= displayed_image
|
||||
|
||||
/// Remove the image from the user's screen
|
||||
/obj/effect/temp_visual/single_user/proc/remove_mind(mob/living/looker)
|
||||
looker.client?.images -= displayed_image
|
||||
|
||||
/obj/effect/temp_visual/single_user/lwap_ping
|
||||
duration = 0.5 SECONDS
|
||||
randomdir = FALSE
|
||||
image_icon = 'icons/obj/projectiles.dmi'
|
||||
image_icon_state = "red_laser"
|
||||
|
||||
/obj/effect/temp_visual/single_user/lwap_ping/Initialize(mapload, mob/living/looker, mob/living/creature)
|
||||
if(!looker || !creature)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
. = ..()
|
||||
displayed_image.pixel_x = (creature.x - looker.x) * 32
|
||||
displayed_image.pixel_y = (creature.y - looker.y) * 32
|
||||
|
||||
/obj/effect/temp_visual/single_user/ai_telegraph
|
||||
duration = 2 SECONDS
|
||||
randomdir = FALSE
|
||||
image_layer = BELOW_MOB_LAYER
|
||||
image_plane = GAME_PLANE
|
||||
image_icon = 'icons/mob/telegraphing/telegraph_holographic.dmi'
|
||||
image_icon_state = "target_box"
|
||||
|
||||
|
||||
/obj/effect/temp_visual/obliteration
|
||||
duration = 2 SECONDS
|
||||
|
||||
|
||||
@@ -206,3 +206,6 @@
|
||||
take_damage(power / 8000, BURN, ENERGY)
|
||||
power -= power / 2000 //walls take a lot out of ya
|
||||
. = ..()
|
||||
|
||||
/obj/structure/fall_and_crush(turf/target_turf, crush_damage, should_crit, crit_damage_factor, datum/tilt_crit/forced_crit, weaken_time, knockdown_time, ignore_gravity, should_rotate, angle, rightable, block_interactions)
|
||||
. = ..(target_turf, crush_damage, should_crit, crit_damage_factor, forced_crit, weaken_time, knockdown_time, ignore_gravity, should_rotate, angle, rightable = TRUE, block_interactions_until_righted = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user