Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #31 from Helixis/hispaupdate
Browse files Browse the repository at this point in the history
Hispaupdate 9/9/23
  • Loading branch information
kokolo21 authored Sep 9, 2023
2 parents 197017d + c574f53 commit 67c886e
Show file tree
Hide file tree
Showing 20 changed files with 149 additions and 65 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@
///from base of mob/swap_hand(): (obj/item)
#define COMSIG_MOB_SWAP_HANDS "mob_swap_hands"
#define COMPONENT_BLOCK_SWAP (1<<0)

///from base of /mob/verb/pointed: (atom/A)
#define COMSIG_MOB_POINTED "mob_pointed"
///from base of mob/living/resist() (/mob/living)
#define COMSIG_LIVING_RESIST "living_resist"
///from base of mob/living/look_up() (/mob/living)
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/// Used in show_hud(); Please ensure this is the same as the maximum index.
#define HUD_VERSIONS 3

#define HOVER_OUTLINE_FILTER "hover_outline"

//1:1 HUD layout stuff
#define UI_BOXCRAFT "EAST-4:22,SOUTH+1:6"
#define UI_BOXAREA "EAST-4:6,SOUTH+1:6"
Expand Down
5 changes: 5 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,11 @@
custom_material.on_applied(src, materials[custom_material] * multiplier * material_modifier, material_flags)
custom_materials[custom_material] += materials[x] * multiplier

/// Returns the indice in filters of the given filter name.
/// If it is not found, returns null.
/atom/proc/get_filter_index(name)
return filter_data?.Find(name)

/**
* Returns true if this atom has gravity for the passed in turf
*
Expand Down
15 changes: 0 additions & 15 deletions code/game/objects/effects/decals/misc.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/obj/effect/temp_visual/point
name = "pointer"
icon = 'icons/hud/screen_gen.dmi'
icon_state = "arrow"
layer = POINT_LAYER
duration = 25

/obj/effect/temp_visual/point/Initialize(mapload, set_invis = 0)
. = ..()
var/atom/old_loc = loc
abstract_move(get_turf(src))
pixel_x = old_loc.pixel_x
pixel_y = old_loc.pixel_y
invisibility = set_invis

//Used by spraybottles.
/obj/effect/decal/chempuff
name = "chemicals"
Expand Down
10 changes: 3 additions & 7 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -882,15 +882,11 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
colour = COLOR_BLUE_GRAY
else
colour = COLOR_BLUE_GRAY
if(outline_filter)
filters -= outline_filter
outline_filter = filter(type="outline", size=1, color=colour)
filters += outline_filter
add_filter(HOVER_OUTLINE_FILTER, 1, list(type="outline", size=1, color=colour))


/obj/item/proc/remove_outline()
if(outline_filter)
filters -= outline_filter
outline_filter = null
remove_filter(HOVER_OUTLINE_FILTER)

/// Called when a mob tries to use the item as a tool.Handles most checks.
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
Expand Down
28 changes: 19 additions & 9 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@
//and now these defines

/obj/structure/flora/rock
icon_state = "basalt"
icon_state = "basalt1"
base_icon_state = "basalt"
desc = "A volcanic rock. Pioneers used to ride these babies for miles."
icon = 'icons/obj/flora/rocks.dmi'
resistance_flags = FIRE_PROOF
Expand Down Expand Up @@ -450,7 +451,8 @@
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)

/obj/structure/flora/rock/pile
icon_state = "lavarocks"
icon_state = "lavarocks1"
base_icon_state = "lavarocks"
desc = "A pile of rocks."

//Jungle grass
Expand All @@ -472,14 +474,15 @@
//Jungle rocks

/obj/structure/flora/rock/jungle
icon_state = "rock"
icon_state = "rock1"
base_icon_state = "rock"
desc = "A pile of rocks."
icon = 'icons/obj/flora/jungleflora.dmi'
density = FALSE

/obj/structure/flora/rock/jungle/Initialize()
. = ..()
icon_state = "[initial(icon_state)][rand(1,5)]"
icon_state = "[base_icon_state][rand(1,5)]"


//Jungle bushes
Expand All @@ -489,16 +492,19 @@
desc = "A wild plant that is found in jungles."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "busha"
base_icon_state = "busha"

/obj/structure/flora/junglebush/Initialize()
icon_state = "[icon_state][rand(1, 3)]"
icon_state = "[base_icon_state][rand(1, 3)]"
. = ..()

/obj/structure/flora/junglebush/b
icon_state = "bushb"
base_icon_state = "bushb"

/obj/structure/flora/junglebush/c
icon_state = "bushc"
base_icon_state = "bushc"

/obj/structure/flora/junglebush/large
icon_state = "bush"
Expand Down Expand Up @@ -816,7 +822,8 @@
name = "lavatic rock"
desc = "A volcanic rock. Lava is gushing from it. "
icon = 'icons/obj/flora/lavarocks.dmi'
icon_state = "basalt"
icon_state = "basalt1"
base_icon_state = "basalt"
light_color = "#ab4907"
light_power = 3
light_range = 2
Expand All @@ -825,7 +832,8 @@
name = "rock shards"
desc = "Jagged shards of volcanic rock protuding from the ground."
icon = 'icons/obj/flora/lavarocks.dmi'
icon_state = "lavarocks"
icon_state = "lavarocks1"
base_icon_state = "lavarocks"
gender = PLURAL

/obj/structure/flora/rock/asteroid
Expand Down Expand Up @@ -890,13 +898,15 @@
/obj/structure/flora/rock/hell
name = "rock"
desc = "A volcanic rock, one of the few familiar things on this planet."
icon_state = "basalt"
icon_state = "basalt1"
base_icon_state = "basalt"
icon = 'icons/obj/flora/rocks.dmi'

/obj/structure/flora/rock/beach
name = "sea stack"
desc = "A column of rock, formed by wave erosion."
icon_state = "basalt"
icon_state = "basalt1"
base_icon_state = "basalt"
icon = 'icons/obj/flora/rocks.dmi'

/obj/structure/flora/tree/dead/barren
Expand Down
33 changes: 0 additions & 33 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -565,39 +565,6 @@
var/msg = "<span class='smallnotice'>[src] makes eye contact with you.</span>"
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, examined_mob, msg), 3)

/**
* Point at an atom
*
* mob verbs are faster than object verbs. See
* [this byond forum post](https://secure.byond.com/forum/?post=1326139&page=2#comment8198716)
* for why this isn't atom/verb/pointed()
*
* note: ghosts can point, this is intended
*
* visible_message will handle invisibility properly
*
* overridden here and in /mob/dead/observer for different point span classes and sanity checks
*/
/mob/verb/pointed(atom/A as mob|obj|turf in view())
set name = "Point To"
set category = "Object"

if(!src || !isturf(src.loc))
return FALSE
if(client && !(A in view(client.view, src)))
return FALSE
if(istype(A, /obj/effect/temp_visual/point))
return FALSE

var/turf/tile = get_turf(A)
if (!tile)
return FALSE

var/turf/our_tile = get_turf(src)
var/obj/visual = new /obj/effect/temp_visual/point(our_tile, invisibility)
animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, time = 1.7, easing = EASE_OUT)

return TRUE

///Can this mob resist (default FALSE)
/mob/proc/can_resist()
Expand Down
107 changes: 107 additions & 0 deletions code/modules/point/point.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#define POINT_TIME (2.5 SECONDS)

/**
* Point at an atom
*
* Intended to enable and standardise the pointing animation for all atoms
*
* Not intended as a replacement for the mob verb
*/
/atom/movable/proc/point_at(atom/pointed_atom)
if(!isturf(loc))
return

if (pointed_atom in src)
create_point_bubble(pointed_atom)
return

var/turf/tile = get_turf(pointed_atom)
if (!tile)
return

var/turf/our_tile = get_turf(src)
var/obj/visual = new /obj/effect/temp_visual/point(our_tile, invisibility)

animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + pointed_atom.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + pointed_atom.pixel_y, time = 1.7, easing = EASE_OUT)

/atom/movable/proc/create_point_bubble(atom/pointed_atom)
var/obj/effect/thought_bubble_effect = new

var/mutable_appearance/thought_bubble = mutable_appearance(
'icons/effects/effects.dmi',
"thought_bubble",
layer = POINT_LAYER,
appearance_flags = KEEP_APART,
)

var/mutable_appearance/pointed_atom_appearance = new(pointed_atom.appearance)
pointed_atom_appearance.blend_mode = BLEND_INSET_OVERLAY
pointed_atom_appearance.plane = thought_bubble.plane
pointed_atom_appearance.layer = FLOAT_LAYER
pointed_atom_appearance.pixel_x = 0
pointed_atom_appearance.pixel_y = 0
thought_bubble.overlays += pointed_atom_appearance

var/hover_outline_index = pointed_atom.get_filter_index(HOVER_OUTLINE_FILTER)
if (!isnull(hover_outline_index))
pointed_atom_appearance.filters.Cut(hover_outline_index, hover_outline_index + 1)

thought_bubble.pixel_x = 16
thought_bubble.pixel_y = 32
thought_bubble.alpha = 200
thought_bubble.mouse_opacity = MOUSE_OPACITY_TRANSPARENT

var/mutable_appearance/point_visual = mutable_appearance(
'icons/hud/screen_gen.dmi',
"arrow",
plane = thought_bubble.plane,
)

thought_bubble.overlays += point_visual

// vis_contents is used to preserve mouse opacity
thought_bubble_effect.appearance = thought_bubble
vis_contents += thought_bubble_effect

QDEL_IN(thought_bubble_effect, POINT_TIME)

/obj/effect/temp_visual/point
name = "pointer"
icon = 'icons/hud/screen_gen.dmi'
icon_state = "arrow"
layer = POINT_LAYER
duration = POINT_TIME

/obj/effect/temp_visual/point/Initialize(mapload, set_invis = 0)
. = ..()
var/atom/old_loc = loc
abstract_move(get_turf(src))
pixel_x = old_loc.pixel_x
pixel_y = old_loc.pixel_y
invisibility = set_invis

#undef POINT_TIME

/**
* Point at an atom
*
* mob verbs are faster than object verbs. See
* [this byond forum post](https://secure.byond.com/forum/?post=1326139&page=2#comment8198716)
* for why this isn't atom/verb/pointed()
*
* note: ghosts can point, this is intended
*
* visible_message will handle invisibility properly
*
* overridden here and in /mob/dead/observer for different point span classes and sanity checks
*/
/mob/verb/pointed(atom/A as mob|obj|turf in view())
set name = "Point To"
set category = "Object"
if(client && !(A in view(client.view, src)))
return FALSE
if(istype(A, /obj/effect/temp_visual/point))
return FALSE
point_at(A)
SEND_SIGNAL(src, COMSIG_MOB_POINTED, A)
return TRUE
10 changes: 10 additions & 0 deletions html/changelogs/archive/2023-09.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@
thgvr:
- rscdel: Clown cargo crate
- rscdel: Clown stuff in costume vendors
2023-09-06:
Skies-Of-Blue:
- rscadd: pointing at something on yourself now shows the item
Zevotech:
- bugfix: Most rocks are now visible again
- rscadd: Most flora files now have missing texture sprites to make it easier to
spot when something has gone wrong.
2023-09-09:
Zevotech:
- bugfix: fixed the icon states for junglebushes a, b, and c.
Binary file modified icons/effects/effects.dmi
Binary file not shown.
Binary file modified icons/obj/flora/ausflora.dmi
Binary file not shown.
Binary file modified icons/obj/flora/grass-sticks.dmi
Binary file not shown.
Binary file modified icons/obj/flora/hellflora.dmi
Binary file not shown.
Binary file modified icons/obj/flora/jungleflora.dmi
Binary file not shown.
Binary file modified icons/obj/flora/lavarocks.dmi
Binary file not shown.
Binary file modified icons/obj/flora/plants.dmi
Binary file not shown.
Binary file modified icons/obj/flora/rocks.dmi
Binary file not shown.
Binary file modified icons/obj/flora/snowflora.dmi
Binary file not shown.
Binary file modified icons/obj/flora/tall_trees_dead.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2898,6 +2898,7 @@
#include "code\modules\plumbing\plumbers\reaction_chamber.dm"
#include "code\modules\plumbing\plumbers\splitters.dm"
#include "code\modules\plumbing\plumbers\synthesizer.dm"
#include "code\modules\point\point.dm"
#include "code\modules\power\apc.dm"
#include "code\modules\power\cable.dm"
#include "code\modules\power\cell.dm"
Expand Down

0 comments on commit 67c886e

Please sign in to comment.