Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse committed Sep 30, 2021
2 parents eed1cb9 + e379588 commit a0f6774
Show file tree
Hide file tree
Showing 272 changed files with 31,265 additions and 22,686 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ ifneq (,$(findstring clang,$(COMPILER)))
CLANG = $(COMPILER)
endif

# Windows sets the OS environment variable so we can cheaply test for it.
ifneq (,$(findstring Windows_NT,$(OS)))
IS_WINDOWS_HOST = 1
else
IS_WINDOWS_HOST = 0
endif

OS = $(shell uname -s)

ifneq ($(findstring Darwin,$(OS)),)
Expand Down Expand Up @@ -1164,11 +1171,28 @@ etags: $(ASTYLE_SOURCES)
etags $^
./tools/json_tools/cddatags.py

ifneq ($(IS_WINDOWS_HOST),1)
# Parallel astyle for posix hosts where fork and filesystem are cheap.

ASTYLE_CHECK_STAMPS = $(sort $(patsubst %,$(ODIR)/%.astyle-check-stamp,$(ASTYLE_SOURCES)))
astyle: $(ASTYLE_CHECK_STAMPS)
$(ASTYLE_CHECK_STAMPS): $(ODIR)/%.astyle-check-stamp : %
$(ASTYLE_BINARY) --options=.astylerc -n $< && mkdir -p $(@D) && touch $@

else
# Serial astyle for Windows hosts which processes all files in one invocation.

astyle: $(ODIR)/.astyle-check-stamp
$(ODIR)/.astyle-check-stamp: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $?
mkdir -p $(@D) && touch $@

endif

astyle-all: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)
mkdir -p $(ODIR) && touch $(ODIR)/.astyle-check-stamp

# Test whether the system has a version of astyle that supports --dry-run
ifeq ($(shell if $(ASTYLE_BINARY) -Q -X --dry-run src/game.h > /dev/null; then echo foo; fi),foo)
ASTYLE_CHECK=$(shell $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q --ascii $(ASTYLE_SOURCES))
Expand Down
16 changes: 10 additions & 6 deletions build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ function run_test
{
set -eo pipefail
test_exit_code=0 sed_exit_code=0 exit_code=0
$WINE $1 --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS $4 $5 "$2" 2>&1 | sed -E 's/^(::(warning|error|debug)[^:]*::)?/\1'"$3"'/' || test_exit_code="${PIPESTATUS[0]}" sed_exit_code="${PIPESTATUS[1]}"
test_bin=$1
prefix=$2
shift 2

$WINE "$test_bin" --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS "$@" 2>&1 | sed -E 's/^(::(warning|error|debug)[^:]*::)?/\1'"$prefix"'/' || test_exit_code="${PIPESTATUS[0]}" sed_exit_code="${PIPESTATUS[1]}"
if [ "$test_exit_code" -ne "0" ]
then
echo "$3test exited with code $test_exit_code"
Expand Down Expand Up @@ -183,8 +187,8 @@ then
make -j$num_jobs
cd ..
# Run regular tests
[ -f "${bin_path}cata_test" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test' {} '('{}')=> ' --user-dir=test_user_dir_{#}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
[ -f "${bin_path}cata_test-tiles" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test-tiles' {} '('{}')=> ' --user-dir=test_user_dir_{#}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
[ -f "${bin_path}cata_test" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
[ -f "${bin_path}cata_test-tiles" ] && parallel --verbose --linebuffer "run_test $(printf %q "${bin_path}")'/cata_test-tiles' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
fi
elif [ "$NATIVE" == "android" ]
then
Expand All @@ -205,10 +209,10 @@ else

export ASAN_OPTIONS=detect_odr_violation=1
export UBSAN_OPTIONS=print_stacktrace=1
parallel -j "$num_test_jobs" --verbose --linebuffer "run_test './tests/cata_test' {} '('{}')=> ' --user-dir=test_user_dir_{#}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
parallel -j "$num_test_jobs" --verbose --linebuffer "run_test './tests/cata_test' '('{}')=> ' --user-dir=test_user_dir_{#} {}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
if [ -n "$MODS" ]
then
parallel -j "$num_test_jobs" --verbose --linebuffer "run_test './tests/cata_test '$(printf %q "${MODS}") {} 'Mods-('{}')=> ' --user-dir=modded_{#}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
parallel -j "$num_test_jobs" --verbose --linebuffer "run_test './tests/cata_test' 'Mods-('{}')=> ' $(printf %q "${MODS}") --user-dir=modded_{#} {}" ::: "crafting_skill_gain" "[slow] ~crafting_skill_gain" "~[slow] ~[.]"
fi

if [ -n "$TEST_STAGE" ]
Expand All @@ -220,7 +224,7 @@ else
./build-scripts/get_all_mods.py | \
while read mods
do
run_test './tests/cata_test '~*' ' --user-dir=all_modded --mods='"${mods}"'
run_test ./tests/cata_test '(all_mods)=> ' '~*' --user-dir=all_modded --mods="${mods}"
done
fi
fi
Expand Down
132 changes: 109 additions & 23 deletions data/json/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@
{
"id": "bio_armor_arms",
"type": "bionic",
"name": { "str": "Alloy Plating - Arms" },
"description": "The flesh on your arms has been surgically replaced by alloy plating. Provides passive protection and can be used in conjunction with bionic martial arts.",
"occupied_bodyparts": [ [ "arm_l", 4 ], [ "arm_r", 4 ] ],
"bash_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ] ],
"cut_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ] ],
"bullet_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ] ],
"name": { "str": "Intradermal Alloy - Arms" },
"description": "An advanced protective meshwork has been woven into the flesh on your arms and hands, protecting them from physical trauma.",
"occupied_bodyparts": [ [ "arm_l", 4 ], [ "arm_r", 4 ], [ "hand_l", 1 ], [ "hand_r", 1 ] ],
"bash_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ], [ "hand_l", 3 ], [ "hand_r", 3 ] ],
"cut_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ], [ "hand_l", 3 ], [ "hand_r", 3 ] ],
"bullet_protec": [ [ "arm_l", 3 ], [ "arm_r", 3 ], [ "hand_l", 3 ], [ "hand_r", 3 ] ],
"encumbrance": [ [ "arm_l", 1 ], [ "arm_r", 1 ], [ "hand_l", 1 ], [ "hand_r", 1 ] ],
"cant_remove_reason": "The Intradermal Alloy is too thoroughly entwined with %1$s to be removed safely.",
"flags": [ "BIONIC_NPC_USABLE", "BIONIC_SHOCKPROOF" ],
"mutation_conflicts": [
"THICKSKIN",
Expand Down Expand Up @@ -118,7 +120,26 @@
"CLAWS_TENTACLES",
"ACIDPROOF",
"TOXICFLESH",
"FRESHWATEROSMOSIS"
"FRESHWATEROSMOSIS",
"PAWS",
"PAWS_LARGE",
"NAILS",
"TALONS",
"CLAWS",
"CLAWS_RETRACT",
"CLAWS_RAT",
"CLAWS_ST",
"WEBBED",
"PATCHSKIN1",
"PATCHSKIN2",
"RABBIT_FUR",
"PAWS_LITTLE",
"BOVINE_BULK",
"BOVINE_BULK2",
"FAT",
"SLIME_SPRAY",
"MUCUS_SECRETION",
"MUCUS_SECRETION2"
]
},
{
Expand All @@ -131,18 +152,22 @@
"bash_protec": [ [ "eyes", 3 ] ],
"cut_protec": [ [ "eyes", 3 ] ],
"bullet_protec": [ [ "eyes", 3 ] ],
"mutation_conflicts": [ "COMPOUND_EYES", "CEPH_VISION", "CEPH_EYES", "EYEBULGE" ],
"encumbrance": [ [ "eyes", 1 ] ],
"mutation_conflicts": [ "COMPOUND_EYES", "CEPH_VISION", "CEPH_EYES", "EYEBULGE", "EYESTALKS1", "EYESTALKS2" ],
"cant_remove_reason": "The Intradermal Plating is too thoroughly entwined with %1$s to be removed safely.",
"social_modifiers": { "intimidate": 10 }
},
{
"id": "bio_armor_head",
"type": "bionic",
"name": { "str": "Alloy Plating - head" },
"description": "The flesh on your head has been surgically replaced by alloy plating, protecting both your head and jaw regions.",
"name": { "str": "Intradermal Alloy - head" },
"description": "An advanced protective meshwork has been woven into the flesh on your head and jaw region, protecting your skull from physical trauma.",
"occupied_bodyparts": [ [ "head", 3 ], [ "mouth", 1 ] ],
"bash_protec": [ [ "head", 3 ], [ "mouth", 3 ] ],
"cut_protec": [ [ "head", 3 ], [ "mouth", 3 ] ],
"bullet_protec": [ [ "head", 3 ], [ "mouth", 3 ] ],
"encumbrance": [ [ "head", 1 ] ],
"cant_remove_reason": "The Intradermal Alloy is too thoroughly entwined with %1$s to be removed safely.",
"flags": [ "BIONIC_NPC_USABLE", "BIONIC_SHOCKPROOF" ],
"mutation_conflicts": [
"THICKSKIN",
Expand Down Expand Up @@ -220,18 +245,48 @@
"MUZZLE_BEAR",
"MUZZLE_RAT",
"MUZZLE_LONG",
"PROBISCIS"
"PROBISCIS",
"MOUTH_FLAPS",
"MOUTH_TENTACLES",
"MANDIBLES",
"FANGS_SPIDER",
"BEAK",
"BEAK_PECK",
"BEAK_HUM",
"GIZZARD",
"FELINE_EARS",
"CANINE_EARS",
"LUPINE_EARS",
"RABBIT_EARS",
"MOUSE_EARS",
"PATCHSKIN1",
"PATCHSKIN2",
"RABBIT_FUR",
"RABBIT_NOSE",
"SLIT_NOSTRILS",
"WHISKERS",
"WHISKERS_RAT",
"PAWS_LITTLE",
"BOVINE_BULK",
"BOVINE_BULK2",
"FAT",
"SLIME_SPRAY",
"MUCUS_SECRETION",
"MUCUS_SECRETION2",
"WIDE_MOUTH"
]
},
{
"id": "bio_armor_legs",
"type": "bionic",
"name": { "str": "Alloy Plating - Legs" },
"description": "The flesh on your legs has been surgically replaced by alloy plating. Provides passive protection and can be used in conjunction with bionic martial arts.",
"occupied_bodyparts": [ [ "leg_l", 6 ], [ "leg_r", 6 ] ],
"bash_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ] ],
"cut_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ] ],
"bullet_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ] ],
"name": { "str": "Intradermal Alloy - Legs" },
"description": "An advanced protective meshwork has been woven into the flesh on your legs and feet, protecting them from physical trauma.",
"occupied_bodyparts": [ [ "leg_l", 6 ], [ "leg_r", 6 ], [ "foot_l", 1 ], [ "foot_r", 1 ] ],
"bash_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ], [ "foot_l", 3 ], [ "foot_r", 3 ] ],
"cut_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ], [ "foot_l", 3 ], [ "foot_r", 3 ] ],
"bullet_protec": [ [ "leg_l", 3 ], [ "leg_r", 3 ], [ "foot_l", 3 ], [ "foot_r", 3 ] ],
"encumbrance": [ [ "leg_l", 1 ], [ "leg_r", 1 ], [ "foot_l", 1 ], [ "foot_r", 1 ] ],
"cant_remove_reason": "The Intradermal Alloy is too thoroughly entwined with %1$s to be removed safely.",
"flags": [ "BIONIC_NPC_USABLE", "BIONIC_SHOCKPROOF" ],
"mutation_conflicts": [
"THICKSKIN",
Expand Down Expand Up @@ -300,19 +355,38 @@
"TAIL_STING",
"TAIL_CLUB",
"LEG_TENTACLES",
"LEG_TENT_BRACE"
"LEG_TENT_BRACE",
"RAP_TALONS",
"HOOVES",
"PADDED_FEET",
"PATCHSKIN1",
"PATCHSKIN2",
"RABBIT_FUR",
"TAIL_RABBIT",
"RABBIT_FEET",
"PAWS_LITTLE",
"BOVINE_BULK",
"BOVINE_BULK2",
"FAT",
"SLIME_SPRAY",
"GASTROPOD_FOOT",
"GASTROPOD_BALANCE",
"MUCUS_SECRETION",
"MUCUS_SECRETION2"
]
},
{
"id": "bio_armor_torso",
"type": "bionic",
"name": { "str": "Alloy Plating - torso" },
"description": "The flesh on your torso has been surgically replaced by alloy plating, protecting it from physical trauma.",
"name": { "str": "Intradermal Alloy - torso" },
"description": "An advanced protective meshwork has been woven into the flesh on your torso, protecting it from physical trauma.",
"occupied_bodyparts": [ [ "torso", 10 ] ],
"bash_protec": [ [ "torso", 3 ] ],
"cut_protec": [ [ "torso", 3 ] ],
"bullet_protec": [ [ "torso", 3 ] ],
"encumbrance": [ [ "torso", 3 ] ],
"flags": [ "BIONIC_NPC_USABLE", "BIONIC_SHOCKPROOF" ],
"cant_remove_reason": "The Intradermal Alloy is too thoroughly entwined with %1$s to be removed safely.",
"canceled_mutations": [ "VINES1", "VINES2", "VINES3" ],
"mutation_conflicts": [
"THICKSKIN",
Expand Down Expand Up @@ -377,7 +451,19 @@
"ARACHNID_ARMS_OK",
"CLAWS_TENTACLES",
"SHELL",
"SHELL2"
"SHELL2",
"PATCHSKIN1",
"PATCHSKIN2",
"RABBIT_FUR",
"PAWS_LITTLE",
"BOVINE_BULK",
"BOVINE_BULK2",
"FAT",
"SLIME_SPRAY",
"INSECT_RESEVOIR",
"MUCUS_SECRETION",
"MUCUS_SECRETION2",
"SHELL3"
]
},
{
Expand Down Expand Up @@ -924,7 +1010,7 @@
"type": "bionic",
"name": { "str": "Itchy Metal Thing" },
"description": "A bionic of some sort, so badly installed that you cannot even tell what it was originally supposed to be. Sometimes it itches horribly.",
"occupied_bodyparts": [ [ "torso", 3 ], [ "head", 2 ], [ "hand_l", 1 ], [ "hand_r", 1 ] ],
"occupied_bodyparts": [ [ "torso", 3 ], [ "head", 2 ] ],
"flags": [ "BIONIC_FAULTY" ]
},
{
Expand Down Expand Up @@ -1476,7 +1562,7 @@
"description": "Your leg joints have been equipped with servomotors that provide power-assisted movement. Movement takes less effort when this bionic is online. However, when it's offline it will hamper your movement, as you struggle against its moving parts.",
"occupied_bodyparts": [ [ "leg_l", 12 ], [ "leg_r", 12 ] ],
"flags": [ "BIONIC_TOGGLED" ],
"mutation_conflicts": [ "LEG_TENTACLES", "LEG_TENT_BRACE" ],
"mutation_conflicts": [ "LEG_TENTACLES", "LEG_TENT_BRACE", "GASTROPOD_FOOT", "GASTROPOD_BALANCE" ],
"enchantments": [
{ "condition": "ACTIVE", "values": [ { "value": "MOVE_COST", "multiply": -0.1 } ] },
{ "condition": "INACTIVE", "values": [ { "value": "MOVE_COST", "multiply": 0.1 } ] }
Expand Down
6 changes: 3 additions & 3 deletions data/json/effect_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"type": "effect_on_condition",
"id": "scenario_bad_day",
"scenario_specific": true,
"eoc_type": "SCENARIO_SPECIFIC",
"effect": [
{ "u_add_effect": "flu", "intensity": 1, "duration": "1000 minutes" },
{ "u_add_effect": "drunk", "intensity": 1, "duration": "270 minutes" },
Expand All @@ -18,7 +18,7 @@
{
"type": "effect_on_condition",
"id": "scenario_infected",
"scenario_specific": true,
"eoc_type": "SCENARIO_SPECIFIC",
"effect": [
{ "u_add_effect": "infected", "intensity": 1, "duration": "PERMANENT", "target_part": "RANDOM" },
{ "assign_mission": "MISSION_INFECTED_START_FIND_ANTIBIOTICS" }
Expand All @@ -27,7 +27,7 @@
{
"type": "effect_on_condition",
"id": "scenario_fungal_infection",
"scenario_specific": true,
"eoc_type": "SCENARIO_SPECIFIC",
"effect": [ { "u_add_effect": "effect_fungus", "intensity": 1, "duration": "PERMANENT", "target_part": "RANDOM" } ]
},
{
Expand Down
7 changes: 6 additions & 1 deletion data/json/furniture_and_terrain/furniture-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,12 @@
"required_str": 12,
"max_volume": "1000 L",
"flags": [ "CONTAINER", "SEALED", "BLOCKSDOOR", "MOUNTABLE", "FLAT_SURF" ],
"examine_action": "locked_object",
"prying": {
"result": "f_metal_crate_o",
"message": "You wrench open the metal crate.",
"byproducts": [ { "item": "sheet_metal", "count": 1 } ],
"prying_data": { "difficulty": 4, "prying_level": 1, "noisy": true, "failure": "The lid is sealed more tightly than you thought." }
},
"bash": {
"str_min": 30,
"str_max": 150,
Expand Down
27 changes: 27 additions & 0 deletions data/json/furniture_and_terrain/furniture-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,33 @@
},
"crafting_pseudo_item": "fake_drill_press"
},
{
"type": "furniture",
"id": "f_firefly_terrarium",
"name": "firefly terrarium",
"description": "While many survivors would have focused on trying to bring back electric lights, whomever lives here has apparently decided to make use of the changes wrought by the cataclysm to provide light. This vivarium contains soil, strange plants you don't recognize immediately, and most strikingly, a giant mutant firefly.",
"symbol": "#",
"color": "light_green",
"move_cost_mod": 3,
"coverage": 30,
"required_str": 6,
"light_emitted": 25,
"flags": [ "TRANSPARENT", "NOITEM", "BLOCKSDOOR" ],
"bash": {
"str_min": 20,
"str_max": 30,
"sound_fail": "smash!",
"items": [
{ "item": "glass_shard", "count": [ 8, 12 ] },
{ "item": "alien_fern", "count": [ 0, 3 ] },
{ "item": "mutant_meat", "count": [ 2, 4 ] },
{ "item": "material_soil", "count": [ 2, 10 ] },
{ "item": "mutant_bug_hydrogen_sacs", "count": [ 0, 2 ] },
{ "item": "egg_firefly", "count": [ 0, 1 ] },
{ "item": "mutant_bug_organs", "charges": [ 0, 5 ] }
]
}
},
{
"type": "furniture",
"id": "f_tablesaw",
Expand Down
5 changes: 5 additions & 0 deletions data/json/furniture_and_terrain/terrain-doors.json
Original file line number Diff line number Diff line change
Expand Up @@ -2419,6 +2419,11 @@
"roof": "t_flat_roof",
"flags": [ "NOITEM", "REDUCE_SCENT", "OPENCLOSE_INSIDE", "CONNECT_TO_WALL", "LOCKED", "BLOCK_WIND", "PICKABLE" ],
"open": "t_door_metal_o",
"prying": {
"result": "t_door_metal_o",
"message": "You pry open the metal door.",
"prying_data": { "difficulty": 8, "prying_level": 4, "noisy": true, "failure": "The metal door is too thick." }
},
"examine_action": "locked_object_pickable",
"oxytorch": {
"result": "t_mdoor_frame",
Expand Down
Loading

0 comments on commit a0f6774

Please sign in to comment.