Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA authored and GuardianDll committed Aug 19, 2024
1 parent 1043de2 commit d28e49a
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 146 deletions.
86 changes: 0 additions & 86 deletions data/json/furniture_and_terrain/furniture-domestic_plants.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,92 +137,6 @@
"bash": { "str_min": 2, "str_max": 6, "sound": "crunch.", "sound_fail": "whish." },
"plant_data": { "transform": "f_plant_mature", "base": "f_null" }
},
{
"type": "furniture",
"id": "f_mutant_tree_adult",
"name": "mutant tree",
"description": "This bizarre tree spreads its twisted branches at odd angles toward the sky. If you squint, it almost looks like a human figure with its arms raised to catch the sun.",
"symbol": "7",
"color": "light_green",
"required_str": -1,
"move_cost_mod": 0,
"flags": [
"PLANT",
"SEALED",
"TRANSPARENT",
"CONTAINER",
"NOITEM",
"TINY",
"DONT_REMOVE_ROTTEN",
"GROWTH_HARVEST",
"MUTANT_TREE",
"TREE",
"OBSTACLE"
],
"bash": {
"str_min": 18,
"str_max": 50,
"sound": "crunch.",
"sound_fail": "whish.",
"items": [
{ "item": "stick_long", "count": [ 1, 2 ] },
{ "item": "bone", "count": [ 1, 2 ] },
{ "item": "splinter", "count": [ 1, 5 ] },
{ "item": "twig", "count": [ 2, 5 ] },
{ "item": "leaves", "count": [ 5, 25 ] }
]
},
"plant_data": { "transform": "f_null", "base": "f_null" }
},
{
"type": "furniture",
"id": "f_mutant_tree_sapling",
"name": "mutant sapling",
"description": "A twisted and gnarled little tree. Its shape is at once alien and familiar.",
"symbol": "1",
"color": "green",
"move_cost_mod": 1,
"required_str": -1,
"flags": [
"PLANT",
"SEALED",
"TRANSPARENT",
"CONTAINER",
"NOITEM",
"TINY",
"DONT_REMOVE_ROTTEN",
"GROWTH_MATURE",
"SMALL_HIDE",
"YOUNG"
],
"bash": {
"str_min": 8,
"str_max": 50,
"sound": "crunch.",
"sound_fail": "whish.",
"items": [
{ "item": "stick_long", "count": [ 0, 2 ] },
{ "item": "bone", "count": [ 1, 2 ] },
{ "item": "splinter", "count": [ 0, 2 ] },
{ "item": "twig", "count": [ 1, 3 ] },
{ "item": "leaves", "count": [ 5, 20 ] }
]
},
"plant_data": { "transform": "f_mutant_tree_adult", "base": "f_null" }
},
{
"type": "furniture",
"id": "f_mutant_tree_sprout",
"name": "sprout",
"description": "A tiny little sprout that has just begun to grow.",
"symbol": "^",
"color": "green",
"move_cost_mod": 0,
"required_str": -1,
"flags": [ "PLANT", "SEALED", "TRANSPARENT", "CONTAINER", "NOITEM", "TINY", "DONT_REMOVE_ROTTEN", "GROWTH_SEEDLING" ],
"bash": { "str_min": 6, "str_max": 10, "sound": "crunch.", "sound_fail": "whish." },
"plant_data": { "transform": "f_mutant_tree_sapling", "base": "f_null" }
},
{
"type": "furniture",
"id": "f_planter",
Expand Down
10 changes: 1 addition & 9 deletions data/json/items/comestibles/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,14 +1079,6 @@
"symbol": ".",
"flags": [ "TRADER_AVOID", "CANNIBALISM" ],
"color": "brown",
"seed_data": {
"plant_name": "mutant",
"fruit": "null",
"grow": "90 days",
"seedling_form": "f_mutant_tree_sprout",
"mature_form": "f_mutant_tree_sapling",
"harvestable_form": "f_mutant_tree_adult",
"required_terrain_flag": "TREE_PLANTABLE"
}
"seed_data": { "plant_name": "mutant", "fruit": "null", "grow": "90 days", "required_terrain_flag": "TREE_PLANTABLE" }
}
]
91 changes: 91 additions & 0 deletions data/json/obsoletion_and_migration_0.I/obsolete_furniture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[
{
"//": "Obsoleted during 0.H, if I am still obsolete at the time of 0.I stable please migrate me.",
"type": "furniture",
"id": "f_mutant_tree_adult",
"name": "mutant tree",
"description": "This bizarre tree spreads its twisted branches at odd angles toward the sky. If you squint, it almost looks like a human figure with its arms raised to catch the sun.",
"symbol": "7",
"color": "light_green",
"required_str": -1,
"move_cost_mod": 0,
"flags": [
"PLANT",
"SEALED",
"TRANSPARENT",
"CONTAINER",
"NOITEM",
"TINY",
"DONT_REMOVE_ROTTEN",
"GROWTH_HARVEST",
"MUTANT_TREE",
"TREE",
"OBSTACLE"
],
"bash": {
"str_min": 18,
"str_max": 50,
"sound": "crunch.",
"sound_fail": "whish.",
"items": [
{ "item": "stick_long", "count": [ 1, 2 ] },
{ "item": "bone", "count": [ 1, 2 ] },
{ "item": "splinter", "count": [ 1, 5 ] },
{ "item": "twig", "count": [ 2, 5 ] },
{ "item": "leaves", "count": [ 5, 25 ] }
]
},
"plant_data": { "transform": "f_null", "base": "f_null" }
},
{
"//": "Obsoleted during 0.H, if I am still obsolete at the time of 0.I stable please migrate me.",
"type": "furniture",
"id": "f_mutant_tree_sapling",
"name": "mutant sapling",
"description": "A twisted and gnarled little tree. Its shape is at once alien and familiar.",
"symbol": "1",
"color": "green",
"move_cost_mod": 1,
"required_str": -1,
"flags": [
"PLANT",
"SEALED",
"TRANSPARENT",
"CONTAINER",
"NOITEM",
"TINY",
"DONT_REMOVE_ROTTEN",
"GROWTH_MATURE",
"SMALL_HIDE",
"YOUNG"
],
"bash": {
"str_min": 8,
"str_max": 50,
"sound": "crunch.",
"sound_fail": "whish.",
"items": [
{ "item": "stick_long", "count": [ 0, 2 ] },
{ "item": "bone", "count": [ 1, 2 ] },
{ "item": "splinter", "count": [ 0, 2 ] },
{ "item": "twig", "count": [ 1, 3 ] },
{ "item": "leaves", "count": [ 5, 20 ] }
]
},
"plant_data": { "transform": "f_mutant_tree_adult", "base": "f_null" }
},
{
"//": "Obsoleted during 0.H, if I am still obsolete at the time of 0.I stable please migrate me.",
"type": "furniture",
"id": "f_mutant_tree_sprout",
"name": "sprout",
"description": "A tiny little sprout that has just begun to grow.",
"symbol": "^",
"color": "green",
"move_cost_mod": 0,
"required_str": -1,
"flags": [ "PLANT", "SEALED", "TRANSPARENT", "CONTAINER", "NOITEM", "TINY", "DONT_REMOVE_ROTTEN", "GROWTH_SEEDLING" ],
"bash": { "str_min": 6, "str_max": 10, "sound": "crunch.", "sound_fail": "whish." },
"plant_data": { "transform": "f_mutant_tree_sapling", "base": "f_null" }
}
]
24 changes: 0 additions & 24 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14077,30 +14077,6 @@ std::string item::get_plant_name() const
return type->seed->plant_name.translated();
}

std::optional<furn_str_id> item::get_plant_seedling_form() const
{
if( !type->seed ) {
return std::nullopt;
}
return type->seed->seedling_form;
}

std::optional<furn_str_id> item::get_plant_mature_form() const
{
if( !type->seed ) {
return std::nullopt;
}
return type->seed->mature_form;
}

std::optional<furn_str_id> item::get_plant_harvestable_form() const
{
if( !type->seed ) {
return std::nullopt;
}
return type->seed->harvestable_form;
}

bool item::is_dangerous() const
{
if( has_flag( flag_DANGEROUS ) ) {
Expand Down
12 changes: 0 additions & 12 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -1982,18 +1982,6 @@ class item : public visitable
* translated. Returns an empty string for non-seed items.
*/
std::string get_plant_name() const;
/**
* Furniture ID of what the plant grows into. Defaults to f_plant_seedling
*/
std::optional<furn_str_id> get_plant_seedling_form() const;
/**
* Furniture ID of what the plant grows into. Defaults to f_plant_mature
*/
std::optional<furn_str_id> get_plant_mature_form() const;
/**
* Furniture ID of what the plant grows into. Defaults to f_plant_harvestable
*/
std::optional<furn_str_id> get_plant_harvestable_form() const;
/*@}*/
/**
* @name Armor related functions.
Expand Down
6 changes: 0 additions & 6 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ static const ammotype ammo_NULL( "NULL" );
static const damage_type_id damage_bash( "bash" );
static const damage_type_id damage_bullet( "bullet" );

static const furn_str_id furn_f_plant_harvest( "f_plant_harvest" );
static const furn_str_id furn_f_plant_mature( "f_plant_mature" );
static const furn_str_id furn_f_plant_seedling( "f_plant_seedling" );

static const gun_mode_id gun_mode_DEFAULT( "DEFAULT" );
static const gun_mode_id gun_mode_MELEE( "MELEE" );
Expand Down Expand Up @@ -3403,9 +3400,6 @@ void islot_seed::load( const JsonObject &jo )
mandatory( jo, was_loaded, "fruit", fruit_id );
optional( jo, was_loaded, "seeds", spawn_seeds, true );
optional( jo, was_loaded, "byproducts", byproducts );
optional( jo, was_loaded, "seedling_form", seedling_form, furn_f_plant_seedling );
optional( jo, was_loaded, "mature_form", mature_form, furn_f_plant_mature );
optional( jo, was_loaded, "harvestable_form", harvestable_form, furn_f_plant_harvest );
optional( jo, was_loaded, "required_terrain_flag", required_terrain_flag,
ter_furn_flag::TFLAG_PLANTABLE );
}
Expand Down
12 changes: 3 additions & 9 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8293,9 +8293,7 @@ void map::grow_plant( const tripoint &p )
}

rotten_item_spawn( *seed, p );
//Become a seedling
std::optional<furn_str_id> seedling_form = seed->get_plant_seedling_form();
furn_set( p, furn_str_id( seedling_form.value() ) );
furn_set( p, furn_str_id( furn.plant->transform ) );
} else if( seed->age() < plantEpoch * 3 * furn.plant->growth_multiplier ) {
if( has_flag_furn( ter_furn_flag::TFLAG_GROWTH_MATURE, p ) ) {
return;
Expand All @@ -8312,9 +8310,7 @@ void map::grow_plant( const tripoint &p )
if( !has_flag_furn( ter_furn_flag::TFLAG_GROWTH_SEEDLING, p ) ) {
rotten_item_spawn( *seed, p );
}
//Become a mature plant
std::optional<furn_str_id> mature_form = seed->get_plant_mature_form();
furn_set( p, furn_str_id( mature_form.value() ) );
furn_set( p, furn_str_id( furn.plant->transform ) );

} else {
//You've skipped two stages so roll monsters two times
Expand All @@ -8330,9 +8326,7 @@ void map::grow_plant( const tripoint &p )
rotten_item_spawn( *seed, p );
rotten_item_spawn( *seed, p );
}
//Become a harvestable plant.
std::optional<furn_str_id> harvestable_form = seed->get_plant_harvestable_form();
furn_set( p, furn_str_id( harvestable_form.value() ) );
furn_set( p, furn_str_id( furn.plant->transform ) );
}
}
}
Expand Down

0 comments on commit d28e49a

Please sign in to comment.