Skip to content

Commit

Permalink
Merge branch 'master' into branding-the-drugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse authored Jan 18, 2024
2 parents b39c645 + c8c94bf commit 2ff0435
Show file tree
Hide file tree
Showing 345 changed files with 7,961 additions and 4,381 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ jobs:
sound: 1
- name: Windows Tiles x64
mxe: x86_64
libbacktrace: 1
artifact: windows-tiles-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64
mxe: x86_64
libbacktrace: 1
artifact: windows-tiles-sounds-x64
os: ubuntu-latest
ext: zip
Expand All @@ -89,6 +91,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 1
sound: 0
artifact: linux-tiles-x64
Expand All @@ -98,6 +101,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 1
sound: 1
artifact: linux-tiles-sounds-x64
Expand All @@ -107,6 +111,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 0
sound: 0
artifact: linux-curses-x64
Expand Down Expand Up @@ -207,9 +212,6 @@ jobs:
curl -L -o SDL2-devel-2.26.2-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
shasum -a 256 -c ./build-scripts/SDL2-devel-2.26.2-mingw.tar.gz.sha256
sudo tar -xzf SDL2-devel-2.26.2-mingw.tar.gz -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12 --strip-components=2 SDL2-2.26.2/${{ matrix.mxe }}-w64-mingw32
curl -L -o libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz
shasum -a 256 -c ./build-scripts/libbacktrace-${{ matrix.mxe }}-w64-mingw32-sha256
sudo tar -xzf libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz --exclude=LICENSE -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none' && !matrix.wasm
run: |
Expand Down Expand Up @@ -246,10 +248,20 @@ jobs:
shell: bash
run: |
lang/compile_mo.sh all
- name: Build libbacktrace
if: matrix.libbacktrace == 1
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
cd libbacktrace
git checkout 14818b7783eeb9a56c3f0fca78cefd3143f8c5f6
./configure
make -j$((`nproc`+0))
cp LICENSE ${{ github.workspace }}/LICENSE-libbacktrace.txt
sudo make install
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none' && matrix.artifact != 'linux-objectcreator-x64' && !matrix.wasm
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 LIBBACKTRACE=${{ matrix.libbacktrace }} PCH=0 bindist
mv cataclysmdda-0.I.tar.gz cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CDDA (WebAssembly)
if: matrix.wasm
Expand Down Expand Up @@ -298,7 +310,7 @@ jobs:
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc12-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 LIBBACKTRACE=${{ matrix.libbacktrace }} PCH=0 bindist
mv cataclysmdda-0.I.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (windows msvc)
if: runner.os == 'Windows'
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ ifeq ($(BACKTRACE),1)
ifeq ($(LIBBACKTRACE),1)
DEFINES += -DLIBBACKTRACE
LDFLAGS += -lbacktrace
ifneq ("$(wildcard LICENSE-libbacktrace.txt)","")
BINDIST_EXTRAS += LICENSE-libbacktrace.txt
endif
endif
endif

Expand Down
2 changes: 1 addition & 1 deletion build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ else
./build-scripts/get_all_mods.py | \
while read mods
do
run_test ./tests/cata_test '(all_mods)=> ' '~*' --user-dir=all_modded --mods="${mods}"
run_test ./tests/cata_test '(all_mods)=> ' '[force_load_game]' --user-dir=all_modded --mods="${mods}"
done
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/gha_test_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ else
./build-scripts/get_all_mods.py | \
while read mods
do
run_test ./tests/cata_test '(all_mods)=> ' '~*' --user-dir=all_modded --mods="${mods}"
run_test ./tests/cata_test '(all_mods)=> ' '[force_load_game]' --user-dir=all_modded --mods="${mods}"
done
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -3631,7 +3631,7 @@
"max_intensity": 3,
"base_mods": {
"pain_max_val": [ 35 ],
"pain_chance": [ 900 ],
"pain_chance": [ 9000 ],
"pain_min": [ 1 ],
"pain_max": [ 5 ],
"fatigue_chance": [ 900 ],
Expand Down Expand Up @@ -4534,7 +4534,7 @@
"values": [
{
"value": "INTELLIGENCE",
"add": { "math": [ "u_val('effect_intensity','effect:VITRIFYING') * -1 * (ceil(u_val('intelligence') / 6))" ] }
"add": { "math": [ "u_effect_intensity('VITRIFYING') * -1 * (ceil(u_val('intelligence') / 6))" ] }
}
]
}
Expand Down
212 changes: 66 additions & 146 deletions data/json/effects_on_condition/addictions_eocs.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
[
{
"type": "jmath_function",
"id": "addiction_rational",
"num_args": 3,
"//": "(val / max(1, (val - (step * intensity)))) - 1",
"//2": "_0 = val, _1 = step, _2 = intensity",
"return": "(_0 / max(1, (_0 - (_1 * _2)))) - 1"
},
{
"type": "effect_on_condition",
"id": "EOC_CAFFEINE_ADDICTION",
"condition": {
"compare_num": [
{ "rand": 2000 },
"<=",
{ "u_val": "addiction_intensity", "addiction": "caffeine", "mod": { "val": 2000, "step": 20 } }
]
},
"condition": { "math": [ "rand(2000)", "<=", "addiction_rational(2000, 20, u_addiction_intensity('caffeine'))" ] },
"effect": [
{ "u_message": "You want some caffeine.", "type": "warning" },
{ "u_add_morale": "morale_craving_caffeine", "bonus": -5, "max_bonus": -30 },
{
"run_eocs": [
{
"id": "EOC_CAFFEINE_ADDICTION_MODSTIM",
"condition": {
"and": [
{ "compare_num": [ { "u_val": "stim" }, ">", { "u_val": "addiction_intensity", "addiction": "caffeine", "mod": -10 } ] },
{
"compare_num": [ { "rand": 10 }, "<", { "u_val": "addiction_intensity", "addiction": "caffeine" } ]
}
]
},
"effect": { "arithmetic": [ { "u_val": "stim" }, "-=", { "const": 1 } ] }
},
{
"id": "EOC_CAFFEINE_ADDICTION_SHAKES",
"condition": {
"and": [
{ "compare_num": [ { "u_val": "addiction_intensity", "addiction": "caffeine" }, ">=", { "const": 8 } ] },
{
"compare_num": [ { "rand": 392 }, "<", { "u_val": "addiction_intensity", "addiction": "caffeine" } ]
}
]
},
"effect": [
{ "u_message": "Your hands start shaking… you need it bad!", "type": "bad" },
{ "u_add_effect": "shakes", "duration": "2 minutes" }
]
}
"if": {
"and": [
{ "math": [ "u_val('stim')", ">", "u_addiction_intensity('caffeine') * -10" ] },
{ "math": [ "rand(10)", "<", "u_addiction_intensity('caffeine')" ] }
]
},
"then": { "math": [ "u_val('stim')", "--" ] }
},
{
"if": {
"and": [
{ "math": [ "u_addiction_intensity('caffeine')", ">=", "8" ] },
{ "math": [ "rand(392)", "<", "u_addiction_intensity('caffeine')" ] }
]
},
"then": [
{ "u_message": "Your hands start shaking… you need it bad!", "type": "bad" },
{ "u_add_effect": "shakes", "duration": "2 minutes" }
]
}
]
Expand All @@ -49,84 +41,37 @@
"type": "effect_on_condition",
"id": "EOC_SLEEP_ADDICTION",
"//": "Actual effects processed in player::can_sleep(). Here, only prolong this addiction longer than usual.",
"condition": {
"and": [
{ "compare_num": [ { "rand": 2 }, "==", { "const": 1 } ] },
{ "compare_num": [ { "u_val": "addiction_turns", "addiction": "sleeping pill" }, "<", { "const": 0 } ] }
]
},
"effect": { "arithmetic": [ { "u_val": "addiction_turns", "addiction": "sleeping pill" }, "+=", { "const": 1 } ] }
"condition": { "and": [ { "one_in_chance": 2 }, { "math": [ "u_addiction_turns('sleeping pill')", "<", "0" ] } ] },
"effect": { "math": [ "u_addiction_turns('sleeping pill')", "++" ] }
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_R_ADDICTION",
"condition": {
"compare_num": [
{ "rand": 800 },
"<=",
{ "u_val": "addiction_intensity", "addiction": "marloss_r", "mod": { "val": 800, "step": 20 } }
]
},
"condition": { "math": [ "rand(800)", "<=", "addiction_rational(800, 20, u_addiction_intensity('marloss_r'))" ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about luscious pink berries as big as your fist.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_R_ADDICTION_MODFOCUS",
"condition": { "compare_num": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
{ "if": { "math": [ "u_val('focus')", ">", "40" ] }, "then": { "math": [ "u_val('focus')", "--" ] } }
]
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_B_ADDICTION",
"condition": {
"compare_num": [
{ "rand": 800 },
"<=",
{ "u_val": "addiction_intensity", "addiction": "marloss_b", "mod": { "val": 800, "step": 20 } }
]
},
"condition": { "math": [ "rand(800)", "<=", "addiction_rational(800, 20, u_addiction_intensity('marloss_b'))" ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about nutty cyan seeds as big as your hand.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_B_ADDICTION_MODFOCUS",
"condition": { "compare_num": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
{ "if": { "math": [ "u_val('focus')", ">", "40" ] }, "then": { "math": [ "u_val('focus')", "--" ] } }
]
},
{
"type": "effect_on_condition",
"id": "EOC_MARLOSS_Y_ADDICTION",
"condition": {
"compare_num": [
{ "rand": 800 },
"<=",
{ "u_val": "addiction_intensity", "addiction": "marloss_y", "mod": { "val": 800, "step": 20 } }
]
},
"condition": { "math": [ "rand(800)", "<=", "addiction_rational(800, 20, u_addiction_intensity('marloss_y'))" ] },
"effect": [
{ "u_add_morale": "morale_craving_marloss", "bonus": -5, "max_bonus": -30 },
{ "u_message": "You daydream about succulent, pale golden gel, sweet but light.", "type": "info" },
{
"run_eocs": [
{
"id": "EOC_MARLOSS_Y_ADDICTION_MODFOCUS",
"condition": { "compare_num": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
"effect": { "arithmetic": [ { "u_val": "focus" }, "-=", { "const": 1 } ] }
}
]
}
{ "if": { "math": [ "u_val('focus')", ">", "40" ] }, "then": { "math": [ "u_val('focus')", "--" ] } }
]
},
{
Expand All @@ -135,69 +80,44 @@
"condition": { "u_has_trait": "MUT_JUNKIE" },
"effect": [
{
"run_eocs": [
"if": { "math": [ "rand(600)", "<=", "addiction_rational(600, 50, u_addiction_intensity('mutagen'))" ] },
"then": [
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_MORALE",
"condition": {
"compare_num": [ { "rand": 600 }, "<=", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": { "val": 600, "step": 50 } } ]
},
"effect": [
{
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_MORALE_MSG",
"condition": { "compare_num": [ { "rand": 6 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
"effect": { "u_message": "You so miss the exquisite rainbow of post-humanity.", "type": "warning" },
"false_effect": { "u_message": "Your body is SOO booorrrring. Just a little sip to liven things up?", "type": "warning" }
}
]
},
{ "u_add_morale": "morale_craving_mutagen", "bonus": -20, "max_bonus": -200 }
]
"if": { "math": [ "rand(6)", "<", "u_addiction_intensity('mutagen')" ] },
"then": { "u_message": "You so miss the exquisite rainbow of post-humanity.", "type": "warning" },
"else": { "u_message": "Your body is SOO booorrrring. Just a little sip to liven things up?", "type": "warning" }
},
{ "u_add_morale": "morale_craving_mutagen", "bonus": -20, "max_bonus": -200 }
]
},
{
"if": {
"and": [
{ "math": [ "u_val('focus')", ">", "40" ] },
{ "math": [ "rand(800)", "<=", "addiction_rational(800, 20, u_addiction_intensity('mutagen'))" ] }
]
},
"then": [
{ "math": [ "u_val('focus')", "-=", "u_addiction_intensity('mutagen')" ] },
{
"id": "EOC_MUTAGEN_ADDICTION_JUNKIE_FOCUS",
"condition": {
"and": [
{ "compare_num": [ { "u_val": "focus" }, ">", { "const": 40 } ] },
{
"compare_num": [ { "rand": 800 }, "<=", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": { "val": 800, "step": 20 } } ]
}
]
},
"effect": [
{ "arithmetic": [ { "u_val": "focus" }, "-=", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
{
"u_message": "You daydream what it'd be like if you were *different*. Different is good.",
"type": "warning"
}
]
"u_message": "You daydream what it'd be like if you were *different*. Different is good.",
"type": "warning"
}
]
}
],
"false_effect": {
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_NOJUNKIE",
"condition": {
"compare_num": [ { "rand": 500 }, "<=", { "u_val": "addiction_intensity", "addiction": "mutagen", "mod": { "val": 500, "step": 15 } } ]
"false_effect": [
{
"if": { "math": [ "rand(500)", "<=", "addiction_rational(500, 15, u_addiction_intensity('mutagen'))" ] },
"then": [
{
"if": { "math": [ "rand(6)", "<", "u_addiction_intensity('mutagen')" ] },
"then": { "u_message": "You haven't had any mutagen lately.", "type": "warning" },
"else": { "u_message": "You could use some new parts…", "type": "warning" }
},
"effect": [
{
"run_eocs": [
{
"id": "EOC_MUTAGEN_ADDICTION_NOJUNKIE_MSG",
"condition": { "compare_num": [ { "rand": 6 }, "<", { "u_val": "addiction_intensity", "addiction": "mutagen" } ] },
"effect": { "u_message": "You haven't had any mutagen lately.", "type": "warning" },
"false_effect": { "u_message": "You could use some new parts…", "type": "warning" }
}
]
},
{ "u_add_morale": "morale_craving_mutagen", "bonus": -5, "max_bonus": -50 }
]
}
]
}
{ "u_add_morale": "morale_craving_mutagen", "bonus": -5, "max_bonus": -50 }
]
}
]
}
]
Loading

0 comments on commit 2ff0435

Please sign in to comment.