Skip to content

Commit

Permalink
Merge pull request #2 from CleverRaven/master
Browse files Browse the repository at this point in the history
BackToRootsJune9
  • Loading branch information
xanderrootslayer authored Jun 10, 2019
2 parents 282617d + 7cceebd commit 0193cfa
Show file tree
Hide file tree
Showing 259 changed files with 22,579 additions and 6,642 deletions.
36 changes: 23 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,22 @@ ifeq ($(MSYS2),1)
endif

# Enumerations of all the source files and headers.
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
HEADERS = $(wildcard $(SRC_DIR)/*.h)
TESTSRC = $(wildcard tests/*.cpp)
TESTHDR = $(wildcard tests/*.h)
TOOLSRC = $(wildcard tools/json_tools/format/*.[ch]*)
SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
HEADERS := $(wildcard $(SRC_DIR)/*.h)
TESTSRC := $(wildcard tests/*.cpp)
TESTHDR := $(wildcard tests/*.h)
JSON_FORMATTER_SOURCES := tools/format/format.cpp src/json.cpp
CHKJSON_SOURCES := src/chkjson/chkjson.cpp src/json.cpp
TOOLHDR := $(wildcard tools/*/*.h)
# Using sort here because it has the side-effect of deduplicating the list
ASTYLE_SOURCES := $(sort \
$(SOURCES) \
$(HEADERS) \
$(TESTSRC) \
$(TESTHDR) \
$(JSON_FORMATTER_SOURCES) \
$(CHKJSON_SOURCES) \
$(TOOLHDR))

_OBJS = $(SOURCES:$(SRC_DIR)/%.cpp=%.o)
ifeq ($(TARGETSYSTEM),WINDOWS)
Expand Down Expand Up @@ -781,8 +792,8 @@ src/version.cpp: src/version.h
localization:
lang/compile_mo.sh $(LANGUAGES)

$(CHKJSON_BIN): src/chkjson/chkjson.cpp src/json.cpp
$(CXX) $(CXXFLAGS) -Isrc/chkjson -Isrc src/chkjson/chkjson.cpp src/json.cpp -o $(CHKJSON_BIN)
$(CHKJSON_BIN): $(CHKJSON_SOURCES)
$(CXX) $(CXXFLAGS) -Isrc/chkjson -Isrc $(CHKJSON_SOURCES) -o $(CHKJSON_BIN)

json-check: $(CHKJSON_BIN)
./$(CHKJSON_BIN)
Expand Down Expand Up @@ -983,13 +994,12 @@ etags: $(SOURCES) $(HEADERS) $(TESTSRC) $(TESTHDR)
etags $(SOURCES) $(HEADERS) $(TESTSRC) $(TESTHDR)
find data -name "*.json" -print0 | xargs -0 -L 50 etags --append

astyle: $(SOURCES) $(HEADERS) $(TESTSRC) $(TESTHDR) $(TOOLSRC)
$(ASTYLE_BINARY) --options=.astylerc -n $(SOURCES) $(HEADERS)
$(ASTYLE_BINARY) --options=.astylerc -n $(TESTSRC) $(TESTHDR)
astyle: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)

# 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 LC_ALL=C $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q $(SOURCES) $(HEADERS) $(TESTSRC) $(TESTHDR))
ASTYLE_CHECK=$(shell LC_ALL=C $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q $(ASTYLE_SOURCES))
endif

astyle-check:
Expand Down Expand Up @@ -1021,8 +1031,8 @@ endif
style-all-json: json_formatter
find data -name "*.json" -print0 | xargs -0 -L 1 $(JSON_FORMATTER_BIN)

json_formatter: tools/format/format.cpp src/json.cpp
$(CXX) $(CXXFLAGS) -Itools/format -Isrc tools/format/format.cpp src/json.cpp -o $(JSON_FORMATTER_BIN)
json_formatter: $(JSON_FORMATTER_SOURCES)
$(CXX) $(CXXFLAGS) -Itools/format -Isrc $(JSON_FORMATTER_SOURCES) -o $(JSON_FORMATTER_BIN)

tests: version $(BUILD_PREFIX)cataclysm.a
$(MAKE) -C tests
Expand Down
5 changes: 5 additions & 0 deletions data/core/tips.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,10 @@
"type": "snippet",
"category": "tip",
"text": [ "Don't be too greedy. Loot doesn't matter if you're dead." ]
},
{
"type": "snippet",
"category": "tip",
"text": [ "The floor is too hard to sleep on? Try gathering a pile of leaves." ]
}
]
2 changes: 1 addition & 1 deletion data/json/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@
"id": "bio_tools",
"type": "bionic",
"name": "Integrated Toolset",
"description": "Surgically implanted in your hands and fingers is a complete tool set - screwdriver, hammer, wrench, hacksaw, wood saw, boltcutters, drill and heating elements. You can use this in place of many tools when crafting.",
"description": "Surgically implanted in your hands and fingers is a set of tools - screwdriver, hammer, wrench, hacksaw, hand drill, and heating elements. You can use this in place of many tools when crafting.",
"occupied_bodyparts": [ [ "HAND_L", 3 ], [ "HAND_R", 3 ] ],
"fake_item": "toolset",
"included_bionics": [ "bio_tools_extend" ],
Expand Down
13 changes: 12 additions & 1 deletion data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,17 @@
"pre_special": "check_empty",
"post_terrain": "f_straw_bed"
},
{
"type": "construction",
"description": "Build Pile of Leaves",
"category": "FURN",
"required_skills": [ [ "survival", 0 ] ],
"time": "1 m",
"components": [ [ [ "withered", 50 ] ] ],
"pre_note": "Can be deconstructed without tools.",
"pre_special": "check_empty",
"post_terrain": "f_leaves_pile"
},
{
"type": "construction",
"description": "Build Bed from Scratch",
Expand Down Expand Up @@ -2171,7 +2182,7 @@
{
"type": "construction",
"description": "Build Planter",
"catergory": "FURN",
"category": "FURN",
"required_skills": [ [ "fabrication", 3 ] ],
"time": "25 m",
"qualities": [ [ { "id": "HAMMER", "level": 2 }, { "id": "SAW_W", "level": 2 } ] ],
Expand Down
12 changes: 6 additions & 6 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,10 @@
"desc": [ "Your wounds are bandaged." ],
"main_parts_only": true,
"rating": "good",
"int_dur_factor": 3600,
"int_dur_factor": 21600,
"max_intensity": 16,
"max_effective_intensity": 8,
"max_duration": 57600,
"max_duration": 345600,
"base_mods": { "healing_rate": [ 2 ], "healing_head": [ 50 ], "healing_torso": [ 150 ] },
"scaling_mods": { "healing_rate": [ 2 ] }
},
Expand All @@ -763,10 +763,10 @@
"desc": [ "Your wounds are disinfected." ],
"main_parts_only": true,
"rating": "good",
"int_dur_factor": 3600,
"int_dur_factor": 21600,
"max_intensity": 16,
"max_effective_intensity": 8,
"max_duration": 57600,
"max_duration": 345600,
"base_mods": { "healing_rate": [ 2 ], "healing_head": [ 50 ], "healing_torso": [ 150 ] },
"scaling_mods": { "healing_rate": [ 2 ] }
},
Expand Down Expand Up @@ -1531,8 +1531,8 @@
"name": [ "Started recovery", "Recovering", "Mostly recovered" ],
"desc": [ "This damaged limb is slowly regaining its functions." ],
"//": "Duration is 10 days, but the actual time taken is probabilistic.",
"max_duration": 144000,
"int_dur_factor": 36000,
"max_duration": 864000,
"int_dur_factor": 216000,
"max_intensity": 3,
"rating": "good"
},
Expand Down
6 changes: 6 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"id": "ACTIVE_CLOAKING",
"type": "json_flag",
"context": [ "ARMOR", "TOOL_ARMOR" ],
"info": "This gear has <info>cloaking tech</info> that will <good>make you invisible</good> when active, at the cost of <info>power from a UPS</info>."
},
{
"id": "ALARMCLOCK",
"type": "json_flag",
Expand Down
23 changes: 23 additions & 0 deletions data/json/furniture.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,29 @@
]
}
},
{
"type": "furniture",
"id": "f_leaves_pile",
"name": "pile of leaves",
"symbol": "#",
"description": "A sizeable pile of leaves. You could sleep on it if you don't care about comfort or warmth.",
"color": "brown",
"move_cost_mod": 3,
"coverage": 35,
"comfort": 1,
"floor_bedding_warmth": 50,
"required_str": -1,
"deconstruct": { "items": [ { "item": "withered", "count": 50 } ] },
"max_volume": 4000,
"flags": [ "TRANSPARENT", "FLAMMABLE_ASH", "ORGANIC", "MOUNTABLE", "SHORT", "EASY_DECONSTRUCT" ],
"bash": {
"str_min": 2,
"str_max": 6,
"sound": "crunch!",
"sound_fail": "whump.",
"items": [ { "item": "withered", "count": [ 45, 50 ] } ]
}
},
{
"type": "furniture",
"id": "f_sink",
Expand Down
7 changes: 7 additions & 0 deletions data/json/game_balance.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,12 @@
"info": "Disables robot spawning from alerts and from being wanted.",
"stype": "bool",
"value": false
},
{
"type": "EXTERNAL_OPTION",
"name": "CRAZY",
"info": "A boolean specifically for Crazy Cataclysm.",
"stype": "bool",
"value": false
}
]
12 changes: 12 additions & 0 deletions data/json/itemgroups/books.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,18 @@
"type": "item_group",
"items": [ [ "record_patient", 100 ] ]
},
{
"id": "fireman_doc",
"type": "item_group",
"items": [
[ "textbook_fireman", 100 ],
[ "emergency_book", 100 ],
[ "manual_first_aid", 50 ],
[ "manual_swimming", 50 ],
[ "textbook_firstaid", 10 ],
[ "mag_computer", 50 ]
]
},
{
"id": "tailorbooks",
"type": "item_group",
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{ "group": "elecsto_stor", "count": [ 1, 2 ], "prob": 30 },
{ "item": "money_bundle", "count": [ 1, 10 ], "prob": 20 },
{ "item": "scorecard", "count": [ 1, 10 ], "prob": 10 },
{ "item": "survnote", "count": [ 1, 10 ], "prob": 10 },
{ "item": "survnote", "prob": 10 },
{ "item": "flyer", "count": [ 1, 10 ], "prob": 30 },
{ "item": "character_sheet", "count": [ 1, 2 ], "prob": 5 },
{ "item": "phonebook", "prob": 10 },
Expand Down
4 changes: 4 additions & 0 deletions data/json/itemgroups/robofac_trade.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"type": "item_group",
"id": "robofac_basic_trade",
"subtype": "distribution",
"entries": [
{ "group": "bionics_common", "prob": 100 },
{ "group": "textbooks", "prob": 100 },
Expand All @@ -17,16 +18,19 @@
{
"type": "item_group",
"id": "robofac_id_cards",
"subtype": "distribution",
"items": [ [ "id_science", 90 ], [ "id_military", 5 ], [ "id_industrial", 5 ] ]
},
{
"type": "item_group",
"id": "robofac_basic_grenades",
"subtype": "distribution",
"items": [ [ "EMPbomb", 70 ], [ "scrambler", 30 ] ]
},
{
"type": "item_group",
"id": "robofac_basic_robots",
"subtype": "distribution",
"items": [ [ "bot_manhack", 40 ], [ "bot_skitterbot", 25 ] ]
}
]
2 changes: 1 addition & 1 deletion data/json/items/armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -6979,7 +6979,7 @@
"activate_msg": "Your optical cloak flickers as it becomes transparent.",
"deactive_msg": "Your optical cloak flickers for a moment as it becomes opaque."
},
"flags": [ "OVERSIZE", "HOOD", "WATERPROOF", "OUTER", "VARSIZE" ]
"flags": [ "OVERSIZE", "HOOD", "WATERPROOF", "OUTER", "VARSIZE", "ACTIVE_CLOAKING" ]
},
{
"id": "panties",
Expand Down
20 changes: 20 additions & 0 deletions data/json/items/basecamp.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
"max_charges": 50000,
"charge_factor": 25
},
{
"id": "fake_forge",
"type": "TOOL",
"copy-from": "fake_item",
"name": "basecamp forge",
"description": "A fake forge used for basecamps.",
"sub": "char_forge",
"ammo": "charcoal",
"max_charges": 2000
},
{
"id": "fake_char_kiln",
"type": "TOOL",
"copy-from": "fake_item",
"name": "basecamp kiln",
"description": "A fake kiln used for basecamps.",
"sub": "char_kiln",
"ammo": "charcoal",
"max_charges": 2000
},
{
"id": "fake_stove",
"type": "TOOL",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/bionics.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
"copy-from": "bionic_general_npc_usable",
"type": "BIONIC_ITEM",
"name": "Integrated Toolset CBM",
"description": "Surgically implanted in your hands and fingers is a complete tool set - screwdriver, hammer, wrench, hacksaw, wood saw, boltcutters, drill and heating elements. You can use this in place of many tools when crafting.",
"description": "Surgically implanted in your hands and fingers is set of tools - screwdriver, hammer, wrench, hacksaw, hand drill, and heating elements. You can use this in place of many tools when crafting.",
"price": 800000,
"difficulty": 6
},
Expand Down
8 changes: 4 additions & 4 deletions data/json/items/chemicals_and_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"name": "anesthetic",
"category": "chems",
"description": "A variety of powerful hypnotic, analgetic, and stimulative drugs. It's intended for use in specialized medical equipment, and can't be administered manually. You can reload an anesthesia kit with it.",
"weight": 100,
"volume": 12,
"price": 50000,
"weight": "714 mg",
"volume": "540 ml",
"price": 8333,
"ammo_type": "anesthetic",
"count": 3,
"count": 540,
"phase": "liquid",
"container": "jar_3l_glass",
"symbol": "!",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"symbol": "%",
"color": "light_gray",
"name": "withered plant",
"description": "A dead plant. Good for starting fires.",
"description": "A dead plant. Good for starting fires or making a pile of leaves to sleep on.",
"material": "paper",
"weight": 20,
"volume": 1,
Expand Down
4 changes: 3 additions & 1 deletion data/json/items/gun/bio.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
"dispersion": 30,
"durability": 10,
"loudness": 12,
"modes": [ [ "DEFAULT", "single shot", 1 ], [ "burst", "triple shot", 3 ] ],
"reload": 500,
"ammo_effects": [ "PLASMA", "EXPLOSIVE", "FLAME" ],
"built_in_mods": [ "bio_powershot" ],
"ammo_effects": [ "PLASMA" ],
"flags": [ "NEVER_JAMS", "TRADER_AVOID" ]
},
{
Expand Down
23 changes: 23 additions & 0 deletions data/json/items/gunmod/bionicmods.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"id": "bio_powershot",
"type": "GUNMOD",
"name": "Power shot",
"description": "This is a pseudo item -- the builtin part of a fusion blaster for the maximum power firing mode.",
"weight": 1,
"volume": 0,
"price": 85000,
"material": [ "steel" ],
"symbol": ":",
"color": "light_red",
"location": "underbarrel",
"gun_data": {
"skill": "rifle",
"range": 30,
"ranged_damage": 1,
"ammo_effects": [ "PLASMA", "EXPLOSIVE", "FLAME", "NPC_AVOID" ],
"durability": 10
},
"flags": [ "IRREMOVABLE" ]
}
]
Loading

0 comments on commit 0193cfa

Please sign in to comment.