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

Commit

Permalink
Merge branch 'main' into LightingTest
Browse files Browse the repository at this point in the history
  • Loading branch information
silverplatedelta committed Apr 15, 2024
2 parents 7392cec + e08bec9 commit 8f49b35
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 71 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
FROM tgstation/byond:513.1490 as base

FROM base as build_base

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates

FROM build_base as rust_g

WORKDIR /rust_g

RUN apt-get install -y --no-install-recommends \
libssl-dev \
pkg-config \
curl \
gcc-multilib \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y --default-host i686-unknown-linux-gnu \
&& git init \
&& git remote add origin https://github.com/tgstation/rust-g

COPY dependencies.sh .

RUN /bin/bash -c "source dependencies.sh \
&& git fetch --depth 1 origin \$RUST_G_VERSION" \
&& git checkout FETCH_HEAD \
&& ~/.cargo/bin/cargo build --release

FROM build_base as bsql

WORKDIR /bsql

RUN apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
make \
g++-7 \
libmariadb-client-lgpl-dev \
&& git init \
&& git remote add origin https://github.com/tgstation/BSQL

COPY dependencies.sh .

RUN /bin/bash -c "source dependencies.sh \
&& git fetch --depth 1 origin \$BSQL_VERSION" \
&& git checkout FETCH_HEAD

WORKDIR /bsql/artifacts

ENV CC=gcc-7 CXX=g++-7

RUN ln -s /usr/include/mariadb /usr/include/mysql \
&& ln -s /usr/lib/i386-linux-gnu /root/MariaDB \
&& cmake .. \
&& make

FROM base as dm_base

WORKDIR /tgstation

FROM dm_base as build

COPY . .

RUN DreamMaker -max_errors 0 tgstation.dme && tools/deploy.sh /deploy

FROM dm_base

EXPOSE 1337

RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
libmariadb2 \
mariadb-client \
libssl1.0.0 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /root/.byond/bin

COPY --from=rust_g /rust_g/target/release/librust_g.so /root/.byond/bin/rust_g
COPY --from=bsql /bsql/artifacts/src/BSQL/libBSQL.so ./
COPY --from=build /deploy ./

#bsql fexists memes
RUN ln -s /tgstation/libBSQL.so /root/.byond/bin/libBSQL.so

VOLUME [ "/tgstation/config", "/tgstation/data" ]

ENTRYPOINT [ "DreamDaemon", "tgstation.dmb", "-port", "1337", "-trusted", "-close", "-verbose" ]
1 change: 1 addition & 0 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

#define LIGHTING_PLANE_ALPHA_VISIBLE 255
#define LIGHTING_PLANE_ALPHA_NV_TRAIT 245
#define LIGHTING_PLANE_ALPHA_LESSER_NV_TRAIT 225
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_AGEUSIA "ageusia"
#define TRAIT_HEAVY_SLEEPER "heavy_sleeper"
#define TRAIT_NIGHT_VISION "night_vision"
#define TRAIT_LESSER_NIGHT_VISION "lesser_night_vision"
#define TRAIT_LIGHT_STEP "light_step"
#define TRAIT_SPIRITUAL "spiritual"
#define TRAIT_FAN_CLOWN "fan_clown"
Expand Down
140 changes: 81 additions & 59 deletions code/controllers/subsystem/rogue/treasury.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,70 +102,92 @@ SUBSYSTEM_DEF(treasury)

//pays to account from treasury (payroll)
/datum/controller/subsystem/treasury/proc/give_money_account(amt, name, source)
if(!amt)
return
if(!name)
return
var/found_account
for(var/X in bank_accounts)
if(X == name)
bank_accounts[X] += amt
found_account = TRUE
break
if(!found_account)
return
if(amt>0)
if(source)
send_ooc_note("<b>The Bank:</b> You recieved money. ([source])", name = name)
log_to_steward("+[amt] from treasury to [name] ([source])")
else
send_ooc_note("<b>The Bank:</b> You recieved money.", name = name)
log_to_steward("+[amt] from treasury to [name]")
else
if(source)
send_ooc_note("<b>The Bank:</b> You were fined. ([source])", name = name)
log_to_steward("[name] was fined [amt] ([source])")
else
send_ooc_note("<b>The Bank:</b> You were fined.", name = name)
log_to_steward("[name] was fined [amt]")
return TRUE
if(!amt)
return
if(!name)
return
var/found_account
if (amt > treasury_value) // Check if the amount exceeds the treasury balance
send_ooc_note("<b>The Bank:</b> Error: Insufficient funds in the treasury to complete the transaction.", name = name)
return FALSE // Return early if the treasury balance is insufficient
for(var/X in bank_accounts)
if(X == name)
if(amt > 0)
bank_accounts[X] += amt // Deposit the money into the player's account
treasury_value -= amt // Deduct the given amount from the treasury
else
// Check if the amount to be fined exceeds the player's account balance
if(abs(amt) > bank_accounts[X])
send_ooc_note("<b>The Bank:</b> Error: Insufficient funds in the player's account to complete the fine.", name = name)
return FALSE // Return early if the player has insufficient funds
bank_accounts[X] -= abs(amt) // Deduct the fine amount from the player's account
treasury_value += abs(amt) // Add the fined amount to the treasury
found_account = TRUE
break
if(!found_account)
return FALSE

if (amt > 0)
// Player received money
if(source)
send_ooc_note("<b>The Bank:</b> You received money. ([source])", name = name)
log_to_steward("+[amt] from treasury to [name] ([source])")
else
send_ooc_note("<b>The Bank:</b> You received money.", name = name)
log_to_steward("+[amt] from treasury to [name]")
else
// Player was fined
if(source)
send_ooc_note("<b>The Bank:</b> You were fined. ([source])", name = name)
log_to_steward("[name] was fined [amt] ([source])")
else
send_ooc_note("<b>The Bank:</b> You were fined.", name = name)
log_to_steward("[name] was fined [amt]")

return TRUE






//increments the treasury and gives the money to the account (deposits)
/datum/controller/subsystem/treasury/proc/generate_money_account(amt, name, source)
if(!amt)
return
treasury_value += amt
var/found_account
for(var/X in bank_accounts)
if(X == name)
bank_accounts[X] += amt
found_account = TRUE
break
if(!found_account)
log_to_steward("+[amt] deposited by anonymous.")
return
if(source)
log_to_steward("+[amt] deposited by [name] ([source])")
else
log_to_steward("+[amt] deposited by [name]")
return TRUE
if(!amt)
return
var/found_account
for(var/X in bank_accounts)
if(X == name)
bank_accounts[X] += amt // Deposit the money into the player's account
found_account = TRUE
break
if(!found_account)
log_to_steward("+[amt] deposited by anonymous.")
return
if(source)
log_to_steward("+[amt] deposited by [name] ([source])")
else
log_to_steward("+[amt] deposited by [name]")
return TRUE


/datum/controller/subsystem/treasury/proc/withdraw_money_account(amt, name)
if(!amt)
return
if(treasury_value-amt < 0)
return
var/found_account
for(var/X in bank_accounts)
if(X == name)
bank_accounts[X] -= amt
found_account = TRUE
break
if(!found_account)
return
treasury_value -= amt
log_to_steward("-[amt] withdrawn by [name]")
return TRUE
if(!amt)
return
var/found_account
for(var/X in bank_accounts)
if(X == name)
if(bank_accounts[X] < amt) // Check if the withdrawal amount exceeds the player's account balance
send_ooc_note("<b>The Bank:</b> Error: Insufficient funds in the player's account to complete the withdrawal.", name = name)
return // Return without processing the transaction
bank_accounts[X] -= amt
found_account = TRUE
break
if(!found_account)
return
log_to_steward("-[amt] withdrawn by [name]")
return TRUE


/datum/controller/subsystem/treasury/proc/log_to_steward(log)
log_entries += log
Expand Down
16 changes: 16 additions & 0 deletions code/datums/traits/good.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ datum/quirk/fan_mime
return
eyes.Insert(H) //refresh their eyesight and vision

/datum/quirk/lesser_night_vision
name = "Lesser Night Vision"
desc = ""
value = 1
mob_trait = TRAIT_LESSER_NIGHT_VISION
gain_text = "<span class='notice'>The shadows seem a little less dark.</span>"
lose_text = "<span class='danger'>Everything seems a little darker.</span>"
medical_record_text = "Patient's eyes show above-average acclimation to darkness."

/datum/quirk/lesser_night_vision/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
var/obj/item/organ/eyes/eyes = H.getorgan(/obj/item/organ/eyes)
if(!eyes || eyes.lighting_alpha)
return
eyes.Insert(H) //refresh their eyesight and vision

/datum/quirk/photographer
name = "Photographer"
desc = ""
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/closed/wall/roguewalls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@
above_floor = /turf/open/floor/rogue/concrete
baseturfs = list(/turf/open/floor/rogue/concrete)
climbdiff = 1
damage_deflection = 20
damage_deflection = 20
14 changes: 7 additions & 7 deletions code/modules/jobs/job_types/roguetown/nobility/knight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
min_pq = -4

/datum/job/roguetown/knight/after_spawn(mob/living/L, mob/M, latejoin = TRUE)
..()
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/prev_name = H.name
var/prev_real_name = H.real_name
H.name = "Sir [prev_name]"
H.real_name = "Sir [prev_real_name]"
..()
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/prev_name = H.name
var/prev_real_name = H.real_name
H.name = "Sir [prev_name]"
H.real_name = "Sir [prev_real_name]"


/datum/outfit/job/roguetown/knight/pre_equip(mob/living/carbon/human/H)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,YOUNGBEARD,STUBBLE,OLDGREY)
inherent_traits = list(TRAIT_NOMOBSWAP)
inherent_traits = list(TRAIT_NOMOBSWAP,TRAIT_DRUNK_HEALING)
possible_ages = list(AGE_ADULT, AGE_MIDDLEAGED, AGE_OLD)
default_features = list("mcolor" = "FFF", "wings" = "None")
use_skintones = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
skin_tone_wording = "Origin City-State"

species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,OLDGREY)
inherent_traits = list(TRAIT_NOMOBSWAP)
inherent_traits = list(TRAIT_NOMOBSWAP,TRAIT_NIGHT_VISION)
default_features = list("mcolor" = "FFF", "ears" = "ElfW", "wings" = "None")
use_skintones = 1
skinned_type = /obj/item/stack/sheet/animalhide/human
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,OLDGREY)
inherent_traits = list(TRAIT_NOMOBSWAP)
inherent_traits = list(TRAIT_NOMOBSWAP,TRAIT_NIGHT_VISION)
default_features = list("mcolor" = "FFF", "ears" = "Elf", "wings" = "None")
use_skintones = 1
skinned_type = /obj/item/stack/sheet/animalhide/human
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
skin_tone_wording = "Identifies As"
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,STUBBLE,OLDGREY)
inherent_traits = list(TRAIT_NOMOBSWAP)
inherent_traits = list(TRAIT_NOMOBSWAP,TRAIT_LESSER_NIGHT_VISION)
default_features = list("mcolor" = "FFF", "ears" = "ElfH", "wings" = "None")
mutant_bodyparts = list("ears")
use_skintones = 1
Expand Down
2 changes: 2 additions & 0 deletions code/modules/surgery/organs/eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
eye_color = HMN.eye_color
if(HAS_TRAIT(HMN, TRAIT_NIGHT_VISION) && !lighting_alpha)
lighting_alpha = LIGHTING_PLANE_ALPHA_NV_TRAIT
if(HAS_TRAIT(HMN, TRAIT_LESSER_NIGHT_VISION) && !lighting_alpha)
lighting_alpha =LIGHTING_PLANE_ALPHA_LESSER_NV_TRAIT
M.update_tint()
owner.update_sight()
if(M.has_dna() && ishuman(M))
Expand Down

0 comments on commit 8f49b35

Please sign in to comment.