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

NEW Modular system #175

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
bash tools/ci/check_grep.sh
bash massmeta/tools/massmeta_check_grep.sh # MASSMETA EDIT ADDITION - checking modular_meta code
bash modular_meta/tools/massmeta_check_grep.sh # MASSMETA EDIT ADDITION - checking modular_meta code
- name: Ticked File Enforcement
if: steps.linter-setup.conclusion == 'success' && !cancelled()
run: |
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/___meta_modpaks_includes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "..\..\modular_meta\__config_modpaks.dm"
4 changes: 4 additions & 0 deletions code/__DEFINES/~DELETE_AFTER_MODULARIZATION.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "..\..\massmeta\modular_meta_defines.dm"

//DELETE IT THEN YOU DONE

2 changes: 1 addition & 1 deletion code/__DEFINES/~meta_defines_include.dm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "..\..\massmeta\modular_meta_defines.dm"
#include "..\..\modular_meta\_defines\main_modular_defines_include.dm"
1 change: 1 addition & 0 deletions code/__HELPERS/~meta_helpers_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "..\..\modular_meta\_helpers\main_modular_helpers_include.dm"
9 changes: 0 additions & 9 deletions massmeta/code/modules/uplink/uplink_items/nukeops.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,3 @@
item = /obj/item/clothing/suit/space/hardsuit/shielded/syndi
cost = 20
purchasable_from = UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS

/datum/uplink_item/device_tools/car
name = "BlyatMobile"
desc = "Conquer the New Horizons on 4-passenger seats sedan."
item = /obj/vehicle/sealed/car/cheburek
cost = 40
surplus = 0
purchasable_from = UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS
restricted = TRUE
5 changes: 0 additions & 5 deletions massmeta/modular_meta.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
#include "code\modules\map_vote.dm"
#include "code\modules\hallucination\fake_chat.dm"

//cheburek Car
#include "code\modules\vehicles\cars\cheburek.dm"
#include "code\modules\vehicles\vehicle_actions.dm"
#include "code\modules\cargo\packs\imports.dm"

//buts
#include "code\modules\surgery\organs\internal\butts\butts.dm"
#include "code\modules\surgery\organs\internal\butts\butts_init.dm"
Expand Down
14 changes: 14 additions & 0 deletions modular_meta/__config_modpaks.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Comment define below to remove module from compilation prosses
// If you don't see module name here = you can't off it. Remove code manualy.
// Looks like mods in minecraft, isn't it?
// Some mods may have dependencies, have fun buddy


/// FEATURES

#define CHEBUREK_CAR

/// PEREVODY


/// REVERTS
2 changes: 2 additions & 0 deletions modular_meta/_defines/main_modular_defines_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Put all you modular defines here, it would be pasted right before TG Defines
// So you can easily use your defines in TG code folder, not only in our modular folder
5 changes: 5 additions & 0 deletions modular_meta/_defines/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Тут лежат все наши Новые Defines (определения), что мы определили в нашем модуле.

Все они добавляются непосредственно в `main_modular_defines_include.dm`

Сами дефайны инициализируются сразу после дефайнов офф ТГ в code/\_\_DEFINES/~meta_defines_include.dm (вот такая вот переадресация типа)
2 changes: 2 additions & 0 deletions modular_meta/_helpers/main_modular_helpers_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Put all you modular helpers here, it would be pasted right before TG Helpers
// So you can easily use your helpers in TG code folder, not only in our modular folder
5 changes: 5 additions & 0 deletions modular_meta/_helpers/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Тут лежат все наши Новые Helpers (помощники?), что мы определили в нашем модуле.

Все они добавляются непосредственно в `main_modular_helpers_include.dm`

Сами хелперы инициализируются сразу после хелперов офф ТГ в code/\_\_DEFINES/~meta_helpers_include.dm (такая же переадресация аналогичная как и у дефайнов)
83 changes: 83 additions & 0 deletions modular_meta/_modpacks_subsystem.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#define INIT_ORDER_MODPACKS 84

/datum/modpack
/// A string name for the modpack. Used for looking up other modpacks in init.
var/name
/// A string desc for the modpack. Can be used for modpack verb list as description.
var/desc
/// A string with authors of this modpack.
var/author
// Add info about dependencies and add somethere safety checks, ok?

/datum/modpack/proc/pre_initialize()
if(!name)
return "Modpack name is unset."

/datum/modpack/proc/initialize()
return

/datum/modpack/proc/post_initialize()
return

SUBSYSTEM_DEF(modpacks)
name = "Modpacks"
init_order = INIT_ORDER_MODPACKS
flags = SS_NO_FIRE
var/list/loaded_modpacks = list()

/datum/controller/subsystem/modpacks/Initialize()
var/list/all_modpacks = list()
for(var/modpack in subtypesof(/datum/modpack/))
all_modpacks.Add(new modpack)
// Pre-init and register all compiled modpacks.
for(var/datum/modpack/package as anything in all_modpacks)
var/fail_msg = package.pre_initialize()
if(QDELETED(package))
CRASH("Modpack of type [package.type] is null or queued for deletion.")
if(fail_msg)
CRASH("Modpack [package.name] failed to pre-initialize: [fail_msg].")
if(loaded_modpacks[package.name])
CRASH("Attempted to register duplicate modpack name [package.name].")
loaded_modpacks.Add(package)

// Handle init and post-init (two stages in case a modpack needs to implement behavior based on the presence of other packs).
for(var/datum/modpack/package as anything in all_modpacks)
var/fail_msg = package.initialize()
if(fail_msg)
CRASH("Modpack [(istype(package) && package.name) || "Unknown"] failed to initialize: [fail_msg]")
for(var/datum/modpack/package as anything in all_modpacks)
var/fail_msg = package.post_initialize()
if(fail_msg)
CRASH("Modpack [(istype(package) && package.name) || "Unknown"] failed to post-initialize: [fail_msg]")

return SS_INIT_SUCCESS

/client/verb/modpacks_list()
set name = "Modpacks List"
set category = "OOC"

if(!mob || !SSmodpacks.initialized)
return

// WHERE MYH FANCY TGUI, HUH!&!??
// Need to make groops: Features, Perevody, Reverts
if(length(SSmodpacks.loaded_modpacks))
. = "<hr><br><center><b><font size = 3>Список модификаций</font></b></center><br><hr><br>"
for(var/datum/modpack/M as anything in SSmodpacks.loaded_modpacks)
if(M.name)
. += "<div class = 'statusDisplay'>"
. += "<center><b>[M.name]</b></center>"

if(M.desc || M.author)
. += "<br>"
if(M.desc)
. += "<br>Описание: [M.desc]"
if(M.author)
. += "<br><i>Автор: [M.author]</i>"
. += "</div><br>"

var/datum/browser/popup = new(mob, "modpacks_list", "Список Модификаций", 480, 580)
popup.set_content(.)
popup.open()
else
to_chat(src, "Этот сервер не использует какие-либо модификации.")
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// code/modules/cargo/packs/imports.dm
/datum/supply_pack/imports/sovietvehicle
name = "Soviet Vehicle Exports"
desc = "The most affordable vehicle in the entire galaxy. \
Expand All @@ -12,4 +13,4 @@
/obj/vehicle/sealed/car/cheburek
)
crate_name = "Top Secret"
crate_type = /obj/structure/closet/crate/large/soviet
crate_type = /obj/structure/closet/crate/large/soviet
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Really big car with 4х4 sprite.
*
* Can run people over.
*
* Can run ALL over in "I DRIVE" mode.
*
* Has gearbox, you can break it, and also fix it by yourself!
*
* It can be used in minor events.
*
* Some memes and gags included.
*/
/*
Really big car with 4х4 sprite.

Can run people over.

Can run ALL over in "I DRIVE" mode.

Has gearbox, you can break it, and also fix it by yourself!

It can be used in minor events.

Some memes and gags included.
*/

/obj/vehicle/sealed/car/cheburek
name = "Cheburek"
desc = "The cheapest Bucket with bolts and nuts you can afford"
icon = 'massmeta/icons/obj/toys/shaha.dmi'
icon = 'modular_meta/features/cheburek_car/icons/shaha.dmi'
icon_state = "cheburek" // the name form gta 5, you know?
layer = LYING_MOB_LAYER
max_occupants = 4
Expand Down Expand Up @@ -127,47 +127,6 @@
)
return ..()

//////////////////////////
/////Driveshaft Event/////
//////////////////////////

/obj/effect/immovablerod/driveshaft
name = "hyperspaced driveshaft"
desc = "What the fuck is that?"
icon = 'massmeta/icons/obj/anomaly.dmi'
icon_state = "driveshaft"
notify = FALSE
loopy_rod = TRUE
dnd_style_level_up = FALSE
/// The distance the rod will go.
var/max_distance = 13
/// The turf the rod started from, to calcuate distance.
var/turf/start_turf

/obj/effect/immovablerod/driveshaft/Initialize(mapload, atom/target_atom, atom/specific_target, force_looping = FALSE, max_distance = 13)
. = ..()
start_turf = get_turf(src)
src.max_distance = max_distance

/obj/effect/immovablerod/driveshaft/Destroy(force)
start_turf = null
return ..()

/obj/effect/immovablerod/driveshaft/Move()
if(get_dist(start_turf, get_turf(src)) >= max_distance)
qdel(src)
return
return ..()

/obj/effect/immovablerod/driveshaft/penetrate(mob/living/penetrated)
penetrated.visible_message(
span_danger("[penetrated] is penetrated by a hyperspaced driveshaft!"),
span_userdanger("The [src] penetrates you!"),
span_danger("You hear a CRANG!"),
)
penetrated.adjustBruteLoss(50)


///////////////////////
/////Damage Events/////
///////////////////////
Expand Down Expand Up @@ -227,8 +186,8 @@
add_overlay(image(icon, "open_bonnet_stickers", ABOVE_MOB_LAYER))
else
add_overlay(image(icon, "close_bonnet_stickers", ABOVE_MOB_LAYER))
playsound(src, 'massmeta/sounds/vehicles/gopnik_laught.ogg', 66)
balloon_alert(user, "Some odd insulating tape appeared on [src].")
playsound(src, 'modular_meta/features/cheburek_car/sound/gopnik_laught.ogg', 66)
balloon_alert(user, "some odd insulating tape appeared on [src].")
visible_message(span_userdanger("You hear a terrible roar from under the bottom of the car"))
name = "Cheburek Chad"
desc = "This is a verified Slavic Сar, that's all you need to know"
Expand All @@ -247,14 +206,14 @@
if(obj_flags & EMAGGED)
cut_overlay(image(icon, "open_bonnet_stickers", ABOVE_MOB_LAYER))
add_overlay(image(icon, "close_bonnet_stickers", ABOVE_MOB_LAYER))
playsound(src, 'massmeta/sounds/vehicles/close_bonnet.ogg', 50)
playsound(src, 'modular_meta/features/cheburek_car/sound/close_bonnet.ogg', 50)
else
bonnet_isopen = !bonnet_isopen
add_overlay(image(icon, "car_openbonnet", LYING_MOB_LAYER))
if(obj_flags & EMAGGED)
cut_overlay(image(icon, "close_bonnet_stickers", ABOVE_MOB_LAYER))
add_overlay(image(icon, "open_bonnet_stickers", ABOVE_MOB_LAYER))
playsound(src, 'massmeta/sounds/vehicles/open_bonnet.ogg', 50)
playsound(src, 'modular_meta/features/cheburek_car/sound/open_bonnet.ogg', 50)

/obj/vehicle/sealed/car/cheburek/wrench_act(mob/living/user, obj/item/tool)
if(user.combat_mode)
Expand Down Expand Up @@ -338,22 +297,22 @@
return
if(gopgear == 0 && gearbox_failure_count != 10)
canmove = TRUE
playsound(src, 'massmeta/sounds/vehicles/emergency_brake_release.ogg', 100)
playsound(src, 'modular_meta/features/cheburek_car/sound/emergency_brake_release.ogg', 100)
vehicle_move_delay -= 0.5
gopgear++
return
if(gopgear < 4)
if(prob(gearbox_failure_count * 10) || prob(33))
if(gearbox_failure_count == 10)
if(canmove)
playsound(src, pick('massmeta/sounds/vehicles/gear_blyat.ogg', 'massmeta/sounds/vehicles/gear_nah.ogg'), 100)
playsound(src, pick('modular_meta/features/cheburek_car/sound/gear_blyat.ogg', 'modular_meta/features/cheburek_car/sound/gear_nah.ogg'), 100)
toggle_blinkers()
canmove = FALSE
balloon_alert(user, "Gearbox broken")
balloon_alert(user, "gearbox broken")
else
gearbox_failure_count++
AddElement(/datum/element/waddling)
playsound(src, pick('massmeta/sounds/vehicles/gear_fault.ogg', 'massmeta/sounds/vehicles/gear_fault2.ogg', 'massmeta/sounds/vehicles/gear_fault3.ogg'), 50)
playsound(src, pick('modular_meta/features/cheburek_car/sound/gear_fault.ogg', 'modular_meta/features/cheburek_car/sound/gear_fault2.ogg', 'modular_meta/features/cheburek_car/sound/gear_fault3.ogg'), 50)
addtimer(CALLBACK(src, PROC_REF(revert_waddling)), 1 SECONDS)
else
playsound(src, 'sound/vehicles/mecha/mechmove04.ogg', 75)
Expand All @@ -369,22 +328,22 @@
return
if(gopgear == 1 && gearbox_failure_count != 10)
canmove = FALSE
playsound(src, 'massmeta/sounds/vehicles/emergency_brake_pull.ogg', 100)
playsound(src, 'modular_meta/features/cheburek_car/sound/emergency_brake_pull.ogg', 100)
vehicle_move_delay += 0.5
gopgear--
return
if(gopgear > 1)
if(prob(gearbox_failure_count * 10) || prob(33))
if(gearbox_failure_count == 10)
if(canmove)
playsound(src, pick('massmeta/sounds/vehicles/gear_blyat.ogg', 'massmeta/sounds/vehicles/gear_nah.ogg'), 100)
playsound(src, pick('modular_meta/features/cheburek_car/sound/gear_blyat.ogg', 'modular_meta/features/cheburek_car/sound/gear_nah.ogg'), 100)
toggle_blinkers()
canmove = FALSE
balloon_alert(user, "Gearbox broken")
else
gearbox_failure_count++
AddElement(/datum/element/waddling) // your gears are juggling like a clown do
playsound(src, pick('massmeta/sounds/vehicles/gear_fault.ogg', 'massmeta/sounds/vehicles/gear_fault2.ogg', 'massmeta/sounds/vehicles/gear_fault3.ogg'), 50)
playsound(src, pick('modular_meta/features/cheburek_car/sound/gear_fault.ogg', 'modular_meta/features/cheburek_car/sound/gear_fault2.ogg', 'modular_meta/features/cheburek_car/sound/gear_fault3.ogg'), 50)
addtimer(CALLBACK(src, PROC_REF(revert_waddling)), 1 SECONDS)
else
playsound(src, 'sound/vehicles/mecha/mechmove04.ogg', 75)
Expand Down Expand Up @@ -415,7 +374,7 @@

/obj/vehicle/sealed/car/cheburek/proc/endless_tik()
if(isturnsound_on)
playsound(src, 'massmeta/sounds/vehicles/car_turn_signal.ogg', 60)
playsound(src, 'modular_meta/features/cheburek_car/sound/car_turn_signal.ogg', 60)
//update_overlays()
cut_overlay(image(icon, "car_blinkers", LYING_MOB_LAYER))
blinkers_on = FALSE
Expand Down
39 changes: 39 additions & 0 deletions modular_meta/features/cheburek_car/code/driveshaft_rod.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//////////////////////////
/////Driveshaft Event/////
//////////////////////////

/obj/effect/immovablerod/driveshaft
name = "hyperspaced driveshaft"
desc = "What the fuck is that?"
icon = 'modular_meta/features/cheburek_car/icons/anomaly.dmi'
icon_state = "driveshaft"
notify = FALSE
loopy_rod = TRUE
dnd_style_level_up = FALSE
/// The distance the rod will go.
var/max_distance = 13
/// The turf the rod started from, to calcuate distance.
var/turf/start_turf

/obj/effect/immovablerod/driveshaft/Initialize(mapload, atom/target_atom, atom/specific_target, force_looping = FALSE, max_distance = 13)
. = ..()
start_turf = get_turf(src)
src.max_distance = max_distance

/obj/effect/immovablerod/driveshaft/Destroy(force)
start_turf = null
return ..()

/obj/effect/immovablerod/driveshaft/Move()
if(get_dist(start_turf, get_turf(src)) >= max_distance)
qdel(src)
return
return ..()

/obj/effect/immovablerod/driveshaft/penetrate(mob/living/penetrated)
penetrated.visible_message(
span_danger("[penetrated] is penetrated by a hyperspaced driveshaft!"),
span_userdanger("The [src] penetrates you!"),
span_danger("You hear a CRANG!"),
)
penetrated.adjustBruteLoss(50)
8 changes: 8 additions & 0 deletions modular_meta/features/cheburek_car/code/nukeops_uplink.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/datum/uplink_item/device_tools/car
name = "BlyatMobile"
desc = "Conquer the New Horizons on 4-passenger seats sedan."
item = /obj/vehicle/sealed/car/cheburek
cost = 40
surplus = 0
purchasable_from = UPLINK_NUKE_OPS | UPLINK_CLOWN_OPS
restricted = TRUE
Loading
Loading