Skip to content

Commit

Permalink
Merge pull request #109 from MistakeNot4892/fork/pyrelight
Browse files Browse the repository at this point in the history
Updating Pyrelight from Nebula dev.
  • Loading branch information
MistakeNot4892 authored Dec 21, 2024
2 parents 7cb0041 + bce1a3c commit 4cba91c
Show file tree
Hide file tree
Showing 873 changed files with 6,750 additions and 62,598 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# ignore misc BYOND files
Thumbs.db
*.log
*.int
*.rsc
Expand All @@ -21,6 +20,11 @@ atupdate
config/*
sql/test_db

# misc OS garbage
Thumbs.db
Thumbs.db:encryptable
.DS_Store

# vscode
.vscode/*
*.code-workspace
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#define STANCE_ATTACKING /decl/mob_controller_stance/attacking
#define STANCE_TIRED /decl/mob_controller_stance/tired
#define STANCE_CONTAINED /decl/mob_controller_stance/contained
#define STANCE_BUSY /decl/mob_controller_stance/busy

//basically 'do nothing'
#define STANCE_COMMANDED_STOP /decl/mob_controller_stance/commanded/stop
//follows a target
Expand Down
23 changes: 4 additions & 19 deletions code/__defines/gamemode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,11 @@
#define DEFAULT_TELECRYSTAL_AMOUNT 130
#define IMPLANT_TELECRYSTAL_AMOUNT(x) (round(x * 0.49)) // If this cost is ever greater than half of DEFAULT_TELECRYSTAL_AMOUNT then it is possible to buy more TC than you spend

/////////////////
////WIZARD //////
/////////////////
// SPELL FLAGS
#define Z2NOCAST BITFLAG(0) //if this is added, the spell can't be cast at centcomm
#define INCLUDEUSER BITFLAG(1) //does the spell include the caster in its target selection?
#define IGNOREDENSE BITFLAG(2) //are dense turfs ignored in selection?

/* WIZARD SPELL FLAGS */
#define GHOSTCAST BITFLAG(0) //can a ghost cast it?
#define NEEDSCLOTHES BITFLAG(1) //does it need the wizard garb to cast? Nonwizard spells should not have this
#define NEEDSHUMAN BITFLAG(2) //does it require the caster to be human?
#define Z2NOCAST BITFLAG(3) //if this is added, the spell can't be cast at centcomm
#define NO_SOMATIC BITFLAG(4) //spell will go off if the person is incapacitated or stunned
#define IGNOREPREV BITFLAG(5) //if set, each new target does not overlap with the previous one
//The following flags only affect different types of spell, and therefore overlap
//Targeted spells
#define INCLUDEUSER BITFLAG(6) //does the spell include the caster in its target selection?
#define SELECTABLE BITFLAG(7) //can you select each target for the spell?
#define NOFACTION BITFLAG(8) //Don't do the same as our faction
#define NONONFACTION BITFLAG(9) //Don't do people other than our faction
//AOE spells
#define IGNOREDENSE BITFLAG(10) //are dense turfs ignored in selection?
#define IGNORESPACE BITFLAG(11) //are space turfs ignored in selection?
//End split flags
#define CONSTRUCT_CHECK BITFLAG(12) //used by construct spells - checks for nullrods
#define NO_BUTTON BITFLAG(13) //spell won't show up in the HUD with this
Expand Down
5 changes: 4 additions & 1 deletion code/__defines/structures.dm
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#define STRUCTURE_FLAG_SURFACE BITFLAG(0)
// Structure counts as a surface for the purposes of placing items on.
#define STRUCTURE_FLAG_SURFACE BITFLAG(0)
// Structure takes damage from thrown objects colliding with it.
#define STRUCTURE_FLAG_THROWN_DAMAGE BITFLAG(1)
1 change: 1 addition & 0 deletions code/__defines/subsystem-priority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define SS_PRIORITY_GHOST_IMAGES 10 // Updates ghost client images.
#define SS_PRIORITY_ZCOPY 10 // Builds appearances for Z-Mimic.
#define SS_PRIORITY_PROJECTILES 10 // Projectile processing!
#define SS_PRIORITY_PATHFINDING 10 // Processing pathfinding requests

// SS_BACKGROUND
#define SS_PRIORITY_OBJECTS 100 // processing_objects processing.
Expand Down
4 changes: 3 additions & 1 deletion code/__defines/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define TOPIC_HANDLED BITFLAG(0)
#define TOPIC_REFRESH BITFLAG(1)
#define TOPIC_UPDATE_PREVIEW BITFLAG(2)
// use to force a browse() call, unblocking some rsc operations
/// Return this to force a browse() call, unblocking some rsc operations
#define TOPIC_HARD_REFRESH BITFLAG(3)
/// Return this to indicate the window associated with this Topic() call should be closed.
#define TOPIC_CLOSE BITFLAG(4)
#define TOPIC_REFRESH_UPDATE_PREVIEW (TOPIC_HARD_REFRESH|TOPIC_UPDATE_PREVIEW)
8 changes: 4 additions & 4 deletions code/__globals.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Defined here due to being used immediately below.
#define GET_DECL(D) (ispath(D, /decl) ? (decls_repository.fetched_decls[D] || decls_repository.get_decl(D)) : null)
#define IMPLIED_DECL GET_DECL(__IMPLIED_TYPE__)

// Defined here due to compile order; overrides in macros make the compiler complain.
/decl/global_vars
var/static/list/protected_vars = list("protected_vars") // No editing the protected list!
/decl/global_vars/Initialize()
. = ..()
mark_protected_vars()
/decl/global_vars/proc/mark_protected_vars()
return
/hook/startup/proc/mark_protected_vars()
var/decl/global_vars/global_vars = GET_DECL(/decl/global_vars)
global_vars.mark_protected_vars()
return TRUE

#define GLOBAL_GETTER(NAME, TYPE, VAL) \
var/global##TYPE/##NAME; \
Expand Down
8 changes: 3 additions & 5 deletions code/_global_vars/lists/flavor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,13 @@ GLOBAL_GETTER(cable_colors, /list, SetupCableColors())
/proc/SetupCableColors()
. = list()

var/list/valid_cable_coils = typesof(/obj/item/stack/cable_coil)
for(var/ctype in list(
var/list/valid_cable_coils = typesof(/obj/item/stack/cable_coil) - typesof(
/obj/item/stack/cable_coil/single,
/obj/item/stack/cable_coil/cut,
/obj/item/stack/cable_coil/cyborg,
/obj/item/stack/cable_coil/fabricator,
/obj/item/stack/cable_coil/random
))
valid_cable_coils -= typesof(ctype)
)

var/special_name_mappings = list(/obj/item/stack/cable_coil = "Red")
for(var/coil_type in valid_cable_coils)
Expand All @@ -132,6 +130,6 @@ GLOBAL_GETTER(cable_colors, /list, SetupCableColors())
var/obj/item/stack/cable_coil/C = coil_type
if(!initial(C.can_have_color))
continue
var/color = initial(C.color)
var/color = initial(C.paint_color) || initial(C.color)
.[name] = color
. = sortTim(., /proc/cmp_text_asc)
23 changes: 23 additions & 0 deletions code/_global_vars/lists/jewellery.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var/global/list/random_jewellery_material_types = list(
/decl/material/solid/metal/gold,
/decl/material/solid/metal/silver,
/decl/material/solid/metal/copper,
/decl/material/solid/metal/platinum,
/decl/material/solid/metal/steel,
/decl/material/solid/organic/bone,
/decl/material/solid/organic/wood
)
var/global/list/random_jewellery_gem_types = list(
/obj/item/gemstone/baguette/topaz,
/obj/item/gemstone/baguette/sapphire,
/obj/item/gemstone/baguette/ruby,
/obj/item/gemstone/hexagon/topaz,
/obj/item/gemstone/hexagon/sapphire,
/obj/item/gemstone/hexagon/ruby,
/obj/item/gemstone/octagon/topaz,
/obj/item/gemstone/octagon/sapphire,
/obj/item/gemstone/octagon/ruby,
/obj/item/gemstone/round/topaz,
/obj/item/gemstone/round/sapphire,
/obj/item/gemstone/round/ruby
)
2 changes: 1 addition & 1 deletion code/_helpers/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var/global/list/string_slot_flags = list(
. = new /mob/living/human/dummy/mannequin()
mannequins_[ckey] = .

/hook/global_init/proc/makeDatumRefLists()
/proc/makeDatumRefLists()
// Keybindings
for(var/KB in subtypesof(/datum/keybinding))
var/datum/keybinding/keybinding = KB
Expand Down
8 changes: 0 additions & 8 deletions code/_helpers/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ var/global/next_duration_update = 0
var/global/last_round_duration = 0
var/global/round_start_time = 0

/hook/roundstart/proc/start_timer()
round_start_time = world.time
return 1

/proc/ticks2readable(tick_time)
var/hours = round(tick_time / (1 HOUR))
var/minutes = round((tick_time % (1 HOUR)) / (1 MINUTE))
Expand Down Expand Up @@ -109,10 +105,6 @@ var/global/round_start_time = 0
next_duration_update = world.time + 1 MINUTES
return last_round_duration

/hook/startup/proc/set_roundstart_hour()
roundstart_hour = rand(0, 23)
return TRUE

var/global/midnight_rollovers = 0
var/global/rollovercheck_last_timeofday = 0
/proc/update_midnight_rollover()
Expand Down
2 changes: 2 additions & 0 deletions code/_helpers/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
return 1
return 0

#if DM_VERSION < 516
/proc/sign(x)
return x!=0?x/abs(x):0
#endif

/proc/getline(atom/M,atom/N)//Ultra-Fast Bresenham Line-Drawing Algorithm
var/px=M.x //starting x
Expand Down
6 changes: 3 additions & 3 deletions code/_helpers/washing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
if(!istype(washing))
return
var/mob/living/L = washing
if(L.on_fire)
if(L.is_on_fire())
L.visible_message("<span class='danger'>A cloud of steam rises up as the water hits \the [L]!</span>")
L.ExtinguishMob()
L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily
L.extinguish_fire()
L.adjust_fire_intensity(-20) //Douse ourselves with water to avoid fire more easily
washing.clean()
46 changes: 23 additions & 23 deletions code/_onclick/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

if(silicon_camera.in_camera_mode)
silicon_camera.camera_mode_off()
silicon_camera.captureimage(A, usr)
silicon_camera.captureimage(A, src)
return

A.add_hiddenprint(src)
Expand Down Expand Up @@ -118,10 +118,10 @@
I have no idea why it was in atoms.dm instead of respective files.
*/

/atom/proc/AICtrlAltClick()
/atom/proc/AICtrlAltClick(mob/living/silicon/user)

/obj/machinery/door/airlock/AICtrlAltClick() // Electrifies doors.
if(usr.incapacitated())
/obj/machinery/door/airlock/AICtrlAltClick(mob/living/silicon/user) // Electrifies doors.
if(user.incapacitated())
return
if(!electrified_until)
// permanent shock
Expand All @@ -131,62 +131,62 @@
Topic(src, list("command"="electrify_permanently", "activate" = "0"))
return 1

/atom/proc/AICtrlShiftClick()
/atom/proc/AICtrlShiftClick(mob/living/silicon/user)
return

/atom/proc/AIShiftClick()
/atom/proc/AIShiftClick(mob/living/silicon/user)
return

/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(usr.incapacitated())
/obj/machinery/door/airlock/AIShiftClick(mob/living/silicon/user) // Opens and closes doors!
if(user.incapacitated())
return
if(density)
Topic(src, list("command"="open", "activate" = "1"))
else
Topic(src, list("command"="open", "activate" = "0"))
return 1

/atom/proc/AICtrlClick()
/atom/proc/AICtrlClick(mob/living/silicon/user)
return FALSE

/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(usr.incapacitated())
/obj/machinery/door/airlock/AICtrlClick(mob/living/silicon/user) // Bolts doors
if(user.incapacitated())
return FALSE
if(locked)
Topic(src, list("command"="bolts", "activate" = "0"))
else
Topic(src, list("command"="bolts", "activate" = "1"))
return TRUE

/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
if(usr.incapacitated())
/obj/machinery/power/apc/AICtrlClick(mob/living/silicon/user) // turns off/on APCs.
if(user.incapacitated())
return FALSE
Topic(src, list("breaker"="1"))
return TRUE

/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
if(usr.incapacitated())
/obj/machinery/turretid/AICtrlClick(mob/living/silicon/user) //turns off/on Turrets
if(user.incapacitated())
return FALSE
Topic(src, list("command"="enable", "value"="[!enabled]"))
return TRUE

/atom/proc/AIAltClick(var/atom/A)
return AltClick(A)
/atom/proc/AIAltClick(mob/living/silicon/user)
return AltClick(user)

/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
if(usr.incapacitated())
/obj/machinery/turretid/AIAltClick(mob/living/silicon/user) //toggles lethal on turrets
if(user.incapacitated())
return
Topic(src, list("command"="lethal", "value"="[!lethal]"))
return 1

/obj/machinery/atmospherics/binary/pump/AIAltClick()
return AltClick()
/obj/machinery/atmospherics/binary/pump/AIAltClick(mob/living/silicon/user)
return AltClick(user)

/atom/proc/AIMiddleClick(var/mob/living/silicon/user)
return 0

/obj/machinery/door/airlock/AIMiddleClick() // Toggles door bolt lights.
if(usr.incapacitated())
/obj/machinery/door/airlock/AIMiddleClick(mob/living/silicon/user) // Toggles door bolt lights.
if(user.incapacitated())
return
if(..())
return
Expand Down
10 changes: 5 additions & 5 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
if(holding == A) // Handle attack_self
holding.attack_self(src)
trigger_aiming(TARGET_CAN_CLICK)
usr.update_inhand_overlays(FALSE)
update_inhand_overlays(FALSE)
return 1

//Atoms on your person
Expand All @@ -124,10 +124,10 @@
var/resolved = holding.resolve_attackby(A, src, params)
if(!resolved && A && holding)
holding.afterattack(A, src, 1, params) // 1 indicates adjacency
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
setClickCooldown(DEFAULT_QUICK_COOLDOWN)
else
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
setClickCooldown(DEFAULT_QUICK_COOLDOWN)
UnarmedAttack(A, TRUE)

trigger_aiming(TARGET_CAN_CLICK)
Expand All @@ -151,10 +151,10 @@
var/resolved = holding.resolve_attackby(A, src, params)
if(!resolved && A && holding)
holding.afterattack(A, src, 1, params) // 1: clicking something Adjacent
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
setClickCooldown(DEFAULT_QUICK_COOLDOWN)
else
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
setClickCooldown(DEFAULT_QUICK_COOLDOWN)
UnarmedAttack(A, TRUE)

trigger_aiming(TARGET_CAN_CLICK)
Expand Down
Loading

0 comments on commit 4cba91c

Please sign in to comment.