Skip to content

Commit

Permalink
Item burning code rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolthulhu committed Jun 3, 2016
1 parent 74b98a3 commit 24787bb
Show file tree
Hide file tree
Showing 13 changed files with 396 additions and 235 deletions.
1 change: 1 addition & 0 deletions CataclysmWin.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@
<Unit filename="src/field.h" />
<Unit filename="src/filesystem.cpp" />
<Unit filename="src/filesystem.h" />
<Unit filename="src/fire.h" />
<Unit filename="src/game.cpp" />
<Unit filename="src/game.h" />
<Unit filename="src/game_constants.h" />
Expand Down
1 change: 1 addition & 0 deletions astyled_whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ src/explosion.h
src/faction.h
src/fault.h
src/filesystem.h
src/fire.h
src/game_constants.h
src/gates.h
src/generic_factory.h
Expand Down
171 changes: 153 additions & 18 deletions data/json/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
[ "calcium", 0.1 ],
[ "vitA", 1.0 ],
[ "vitC", 0.5 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 1 },
{ "fuel": 1, "smoke": 1, "burn": 2, "chance": 10 },
{ "fuel": 1, "smoke": 1, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -65,6 +70,11 @@
"edible": true,
"vitamins" : [
[ "vitC", 2.0 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 2, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 1, "burn": 2 },
{ "fuel": 1, "smoke": 1, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -85,7 +95,12 @@
"fire_resist" : 1,
"chip_resist" : 0,
"density" : 1,
"edible": true
"edible": true,
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1 },
{ "fuel": 1, "smoke": 1, "burn": 4 },
{ "fuel": 1, "smoke": 1, "burn": 5 }
]
},{
"type" : "material",
"ident" : "wheat",
Expand All @@ -108,6 +123,11 @@
"edible": true,
"vitamins": [
[ "vitB", 1.0 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 2, "burn": 1 },
{ "fuel": 1, "smoke": 2, "burn": 2 },
{ "fuel": 1, "smoke": 1, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -128,7 +148,12 @@
"fire_resist" : 1,
"chip_resist" : 2,
"density" : 4,
"edible": true
"edible": true,
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1 },
{ "fuel": 1, "smoke": 1, "burn": 2 },
{ "fuel": 1, "smoke": 1, "burn": 3 }
]
},{
"type" : "material",
"ident" : "flesh",
Expand All @@ -153,6 +178,11 @@
[ "calcium", 0.1 ],
[ "vitB", 1.0 ],
[ "iron", 2.0 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 15 },
{ "fuel": 2, "smoke": 3, "burn": 2, "chance": 50 },
{ "fuel": 3, "smoke": 10, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -172,7 +202,12 @@
"elec_resist" : 2,
"fire_resist" : 0,
"chip_resist" : 0,
"density" : 1
"density" : 1,
"burn_data": [
{ "fuel": 10, "smoke": 2, "burn": 10 },
{ "fuel": 10, "smoke": 2, "burn": 10 },
{ "fuel": 10, "smoke": 2, "burn": 10 }
]
},{
"type" : "material",
"ident" : "water",
Expand All @@ -192,7 +227,12 @@
"fire_resist" : 1,
"chip_resist" : 0,
"density" : 1,
"edible": true
"edible": true,
"burn_data": [
{ "fuel": -100, "smoke": 1, "burn": 1 },
{ "fuel": -50, "smoke": 5, "burn": 3 },
{ "fuel": -10, "smoke": 10, "burn": 5 }
]
},{
"type" : "material",
"ident" : "milk",
Expand All @@ -216,6 +256,11 @@
"vitamins" : [
[ "vitB", 0.5 ],
[ "calcium", 1.5 ]
],
"burn_data": [
{ "fuel": -100, "smoke": 1, "burn": 1 },
{ "fuel": -50, "smoke": 5, "burn": 3 },
{ "fuel": -10, "smoke": 10, "burn": 5 }
]
},{
"type" : "material",
Expand All @@ -239,6 +284,11 @@
"edible": true,
"vitamins" : [
[ "calcium", 1.0 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 15 },
{ "fuel": 2, "smoke": 3, "burn": 2, "chance": 50 },
{ "fuel": 3, "smoke": 10, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -264,6 +314,11 @@
[ "calcium", 0.1 ],
[ "vitB", 1.0 ],
[ "iron", 2.0 ]
],
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 15 },
{ "fuel": 2, "smoke": 3, "burn": 2, "chance": 50 },
{ "fuel": 3, "smoke": 10, "burn": 3 }
]
},{
"type" : "material",
Expand All @@ -284,7 +339,12 @@
"elec_resist" : 2,
"fire_resist" : 0,
"chip_resist" : 6,
"density" : 3
"density" : 3,
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 1, "burn": 2 },
{ "fuel": 1, "smoke": 1, "burn": 5 }
]
},{
"type" : "material",
"ident" : "wool",
Expand All @@ -304,7 +364,12 @@
"elec_resist" : 2,
"fire_resist" : 0,
"chip_resist" : 6,
"density" : 9
"density" : 9,
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 1, "burn": 2 },
{ "fuel": 1, "smoke": 1, "burn": 5 }
]
},{
"type" : "material",
"ident" : "leather",
Expand All @@ -324,7 +389,12 @@
"elec_resist" : 2,
"fire_resist" : 2,
"chip_resist" : 10,
"density" : 6
"density" : 6,
"burn_data": [
{ "fuel": 0, "smoke": 0, "burn": 0 },
{ "fuel": 1, "smoke": 3, "burn": 2, "chance": 2 },
{ "fuel": 1, "smoke": 3, "burn": 2 }
]
},{
"type" : "material",
"ident" : "kevlar",
Expand Down Expand Up @@ -383,7 +453,12 @@
"elec_resist" : 2,
"fire_resist" : 1,
"chip_resist" : 8,
"density" : 9
"density" : 9,
"burn_data": [
{ "fuel": 1, "smoke": 3, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 5, "burn": 2 },
{ "fuel": 1, "smoke": 10, "burn": 4 }
]
},{
"type" : "material",
"ident" : "chitin",
Expand All @@ -402,7 +477,12 @@
"elec_resist" : 2,
"fire_resist" : 2,
"chip_resist" : 10,
"density" : 10
"density" : 10,
"burn_data": [
{ "fuel": 0, "smoke": 1, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 3, "burn": 1 },
{ "fuel": 1, "smoke": 5, "burn": 5 }
]
},{
"type" : "material",
"ident" : "bone",
Expand All @@ -425,6 +505,11 @@
"edible": true,
"vitamins" : [
[ "calcium", 2.0 ]
],
"burn_data": [
{ "fuel": 0, "smoke": 0, "burn": 0 },
{ "fuel": 0, "smoke": 1, "burn": 1, "chance": 1 },
{ "fuel": 1, "smoke": 1, "burn": 2 }
]
},{
"type" : "material",
Expand Down Expand Up @@ -463,7 +548,12 @@
"elec_resist" : 2,
"fire_resist" : 0,
"chip_resist" : 0,
"density" : 4
"density" : 4,
"burn_data": [
{ "fuel": 10, "smoke": 1, "burn": 10 },
{ "fuel": 8, "smoke": 1, "burn": 20 },
{ "fuel": 5, "smoke": 1, "burn": 50 }
]
},{
"type" : "material",
"ident" : "wood",
Expand All @@ -484,7 +574,12 @@
"elec_resist" : 2,
"fire_resist" : 1,
"chip_resist" : 10,
"density" : 4
"density" : 4,
"burn_data": [
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 5 },
{ "fuel": 1, "smoke": 1, "burn": 1, "chance": 20 },
{ "fuel": 1, "smoke": 1, "burn": 1 }
]
},{
"type" : "material",
"ident" : "plastic",
Expand All @@ -504,7 +599,12 @@
"elec_resist" : 2,
"fire_resist" : 1,
"chip_resist" : 6,
"density" : 8
"density" : 8,
"burn_data": [
{ "fuel": 1, "smoke": 3, "burn": 1, "chance": 3 },
{ "fuel": 1, "smoke": 3, "burn": 2 },
{ "fuel": 0, "smoke": 3, "burn": 5 }
]
},{
"type" : "material",
"ident" : "glass",
Expand All @@ -523,7 +623,12 @@
"elec_resist" : 2,
"fire_resist" : 3,
"chip_resist" : 0,
"density" : 14
"density" : 14,
"burn_data": [
{ "fuel": 0, "smoke": 0, "burn": 0 },
{ "fuel": 0, "smoke": 0, "burn": 0 },
{ "fuel": 0, "smoke": 0, "burn": 1000, "chance": 20, "//": "More like shattering than melting" }
]
},{
"type" : "material",
"ident" : "iron",
Expand Down Expand Up @@ -676,7 +781,12 @@
"elec_resist" : 4,
"fire_resist" : 20,
"chip_resist" : 8,
"density" : 4
"density" : 4,
"burn_data": [
{ "immune": true },
{ "immune": true },
{ "immune": true }
]
},{
"type" : "material",
"ident" : "gold",
Expand Down Expand Up @@ -778,6 +888,11 @@
[ "vitB", 0.5 ],
[ "calcium", 0.5 ],
[ "iron", 0.5 ]
],
"burn_data": [
{ "fuel": 0, "smoke": 1, "burn": 1 },
{ "fuel": 1, "smoke": 3, "burn": 2 },
{ "fuel": 1, "smoke": 5, "burn": 5 }
]
},{
"type" : "material",
Expand Down Expand Up @@ -836,7 +951,12 @@
"fire_resist" : 0,
"chip_resist" : 0,
"density" : 1,
"edible": true
"edible": true,
"burn_data": [
{ "fuel": 150, "smoke": 0, "burn": 1 },
{ "fuel": 150, "smoke": 0, "burn": 2 },
{ "fuel": 150, "smoke": 0, "burn": 3 }
]
},{
"type" : "material",
"ident" : "oil",
Expand All @@ -856,7 +976,12 @@
"fire_resist" : 0,
"chip_resist" : 0,
"density" : 1,
"edible": true
"edible": true,
"burn_data": [
{ "fuel": 300, "smoke": 3, "burn": 1 },
{ "fuel": 300, "smoke": 3, "burn": 2 },
{ "fuel": 300, "smoke": 3, "burn": 3 }
]
},{
"type" : "material",
"ident" : "hydrocarbons",
Expand All @@ -875,7 +1000,12 @@
"elec_resist" : 0,
"fire_resist" : 0,
"chip_resist" : 0,
"density" : 1
"density" : 1,
"burn_data": [
{ "fuel": 300, "smoke": 6, "burn": 1 },
{ "fuel": 300, "smoke": 6, "burn": 2 },
{ "fuel": 300, "smoke": 6, "burn": 3 }
]
},{
"type" : "material",
"ident" : "neoprene",
Expand All @@ -895,6 +1025,11 @@
"fire_resist" : 2,
"chip_resist" : 5,
"acid_resist" : 1,
"density" : 4
"density" : 4,
"burn_data": [
{ "fuel": 1, "smoke": 3, "burn": 1, "chance": 10 },
{ "fuel": 1, "smoke": 3, "burn": 2 },
{ "fuel": 1, "smoke": 3, "burn": 3 }
]
}
]
3 changes: 0 additions & 3 deletions lua/class_definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,6 @@ classes = {
{ name = "bash_resist", rval = "int", args = { } },
{ name = "bash_resist", rval = "int", args = { "bool" } },
{ name = "brewing_time", rval = "int", args = { } },
{ name = "burn", rval = "bool", args = { "int" } },
{ name = "burn", rval = "bool", args = { } },
{ name = "calc_rot", rval = nil, args = { "tripoint" } },
{ name = "can_holster", rval = "bool", args = { "item" } },
{ name = "can_holster", rval = "bool", args = { "item", "bool" } },
Expand All @@ -920,7 +918,6 @@ classes = {
{ name = "damage_cut", rval = "int", args = { } },
{ name = "deserialize", rval = nil, args = { "string" } },
{ name = "destroyed_at_zero_charges", rval = "bool", args = { } },
{ name = "detonate", rval = nil, args = { "tripoint" } },
{ name = "display_name", rval = "string", args = { "int" } },
{ name = "display_name", rval = "string", args = { } },
{ name = "erase_var", rval = nil, args = { "string" } },
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ SET (CATACLYSM_DDA_HEADERS
${CMAKE_SOURCE_DIR}/src/coordinates.h
${CMAKE_SOURCE_DIR}/src/coordinate_conversions.h
${CMAKE_SOURCE_DIR}/src/field.h
${CMAKE_SOURCE_DIR}/src/fire.h
${CMAKE_SOURCE_DIR}/src/monstergenerator.h
${CMAKE_SOURCE_DIR}/src/monfaction.h
${CMAKE_SOURCE_DIR}/src/event.h
Expand Down
Loading

0 comments on commit 24787bb

Please sign in to comment.