Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

плюшки ватрушки! #136

Merged
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3dbb8a7
Add files via upload
Kenshut Nov 16, 2023
d72627b
Update map_extras.json
Kenshut Nov 16, 2023
9bd997d
Update regional_map_settings.json
Kenshut Nov 16, 2023
e6ec4c5
Add files via upload
Kenshut Nov 16, 2023
0bc7ec4
Add files via upload
Kenshut Nov 16, 2023
599f0ff
Update melee.json
Kenshut Nov 16, 2023
77e5f77
Delete data/json/EOCs/melee_eocs.json
Kenshut Nov 26, 2023
0ef7971
Delete data/json/mapgen/map_extras/laststand.json
Kenshut Nov 26, 2023
a27e551
Add files via upload
Kenshut Nov 26, 2023
638a4f1
Delete data/json/mapgen/map_extras/laststand.json
Kenshut Nov 26, 2023
5a0e0da
Add files via upload
Kenshut Nov 26, 2023
f0d832f
Delete data/json/proficiencies/melee_weapons.json
Kenshut Nov 26, 2023
5c9c112
Add files via upload
Kenshut Nov 26, 2023
de0a221
Add files via upload
Kenshut Nov 26, 2023
ad06d49
Update release.yml
Kenshut Nov 26, 2023
a31bcdd
Update msvc-full-features.yml
Kenshut Nov 26, 2023
68b1748
Update src/condition.h
Kenshut Nov 26, 2023
5da6ee1
Add files via upload
Kenshut Nov 26, 2023
8ef4ed7
Update harvest.json
Kenshut Nov 26, 2023
4d62a7c
Add files via upload
Kenshut Nov 26, 2023
2de87a8
Update triffid.json
Kenshut Nov 26, 2023
de223ac
Update weakpoints.json
Kenshut Nov 26, 2023
e1d85ce
Add files via upload
Kenshut Nov 26, 2023
f0b8493
Update harvest.json
Kenshut Nov 29, 2023
ab2cb2c
Add files via upload
Kenshut Nov 29, 2023
221e4d2
Update fungus.json
Kenshut Nov 29, 2023
c7c527c
Update slimes.json
Kenshut Nov 29, 2023
a96a8d0
Update weakpoints.json
Kenshut Nov 29, 2023
c84112d
Add files via upload
Kenshut Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/msvc-full-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '5b1214315250939257ef5d62ecdcbca18cf4fb1c'
vcpkgGitCommitId: '66444e13a86da7087ee24c342f91801cc6eb9877'

- name: Integrate vcpkg
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '5b1214315250939257ef5d62ecdcbca18cf4fb1c'
vcpkgGitCommitId: '66444e13a86da7087ee24c342f91801cc6eb9877'
- name: Install dependencies (windows msvc) (3/3)
if: runner.os == 'Windows'
run: |
Expand Down
74 changes: 74 additions & 0 deletions data/json/mapgen/map_extras/laststand.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[
{
"type": "monstergroup",
"name": "GROUP_LAST_STAND",
"default": "mon_null",
"monsters": [
{ "monster": "mon_civilian_police", "weight": 1, "cost_multiplier": 1, "ends": "5 days" },
{ "monster": "mon_civilian_zombiefighter", "weight": 4, "cost_multiplier": 1, "ends": "5 days" }
]
},
{
"type": "mapgen",
"method": "json",
"update_mapgen_id": "mx_laststand",
"object": {
"rows": [
" ",
" ",
" ",
" ",
" ################## ",
" ################## ",
" ################## ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ### ### ",
" ################## ",
" ################## ",
" ################## ",
" ",
" ",
" ",
" ",
" "
],
"furniture": {
"#": [
[ "f_barricade_road", 10 ],
[ "f_sandbag_half", 10 ],
[ "f_earthbag_half", 10 ],
[ "f_gravelbag_half", 10 ],
[ "f_table", 10 ],
[ "f_bench", 10 ],
"f_55gal_firebarrel",
"f_30gal_firebarrel",
"f_pallet_brick",
"f_pallet_cement",
"f_stack_plank",
"f_metal_table",
"f_armchair",
"f_chair",
"f_rack",
"f_locker",
"f_displaycase",
"f_recycle_bin",
"f_trashcan",
"f_metal_trashcan",
"f_rubble",
"f_wreckage",
[ "f_null", 150 ]
]
},
"place_monster": [ { "group": "GROUP_LAST_STAND", "x": [ 6, 17 ], "y": [ 6, 16 ], "chance": 100, "repeat": [ 10, 15 ] } ],
"place_loot": [ { "group": "trash", "x": [ 6, 17 ], "y": [ 6, 16 ], "repeat": [ 5, 10 ] } ],
"flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ]
}
}
]
12 changes: 12 additions & 0 deletions data/json/overmap/map_extras.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
"color": "red",
"autonote": true
},
{
"id": "mx_laststand",
"type": "map_extra",
"name": { "str": "Last Stand" },
"description": "Some people made a last stand against the zombies here.",
"generator": { "generator_method": "update_mapgen", "generator_id": "mx_laststand" },
"sym": "X",
"color": "green",
"autonote": true,
"min_max_zlevel": [ 0, 0 ],
"flags": [ "MAN_MADE" ]
},
{
"id": "mx_collegekids",
"type": "map_extra",
Expand Down
2 changes: 1 addition & 1 deletion data/json/regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@
}
},
"bridgehead_ground": { "chance": 5, "extras": { "mx_minefield": 100 } },
"road_nesw_manhole": { "chance": 20, "extras": { "mx_city_trap": 100 } },
"road_nesw_manhole": { "chance": 20, "extras": { "mx_city_trap": 50, "mx_laststand": 50 } },
"build": {
"chance": 90,
"extras": {
Expand Down
14 changes: 14 additions & 0 deletions src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3087,6 +3087,16 @@ void conditional_t::set_has_wielded_with_flag( const JsonObject &jo, const std::
};
}

void conditional_t::set_has_wielded_with_weapon_category( const JsonObject &jo,
const std::string &member,
bool is_npc )
{
str_or_var w_cat = get_str_or_var( jo.get_member( member ), member, true );
condition = [w_cat, is_npc]( dialogue const & d ) {
return d.actor( is_npc )->wielded_with_weapon_category( weapon_category_id( w_cat.evaluate( d ) ) );
};
}

void conditional_t::set_can_see( bool is_npc )
{
condition = [is_npc]( dialogue const & d ) {
Expand Down Expand Up @@ -3388,6 +3398,10 @@ conditional_t::conditional_t( const JsonObject &jo )
set_has_wielded_with_flag( jo, "u_has_wielded_with_flag" );
} else if( jo.has_member( "npc_has_wielded_with_flag" ) ) {
set_has_wielded_with_flag( jo, "npc_has_wielded_with_flag", is_npc );
} else if( jo.has_member( "u_has_wielded_with_weapon_category" ) ) {
set_has_wielded_with_weapon_category( jo, "u_has_wielded_with_weapon_category" );
} else if( jo.has_member( "npc_has_wielded_with_weapon_category" ) ) {
set_has_wielded_with_weapon_category( jo, "npc_has_wielded_with_weapon_category", is_npc );
} else if( jo.has_member( "u_is_on_terrain" ) ) {
set_is_on_terrain( jo, "u_is_on_terrain" );
} else if( jo.has_member( "npc_is_on_terrain" ) ) {
Expand Down
3 changes: 2 additions & 1 deletion src/condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const std::unordered_set<std::string> simple_string_conds = { {
}
};
const std::unordered_set<std::string> complex_conds = { {
"u_has_any_trait", "npc_has_any_trait", "u_has_trait", "npc_has_trait",
"u_has_any_trait","u_has_wielded_with_weapon_category", "npc_has_wielded_with_weapon_category", "npc_has_any_trait", "u_has_trait", "npc_has_trait",
Kenshut marked this conversation as resolved.
Show resolved Hide resolved
"u_has_flag", "npc_has_flag", "u_has_species", "npc_has_species", "u_bodytype", "npc_bodytype", "npc_has_class", "u_has_mission", "u_monsters_in_direction", "u_safe_mode_trigger",
"u_has_strength", "npc_has_strength", "u_has_dexterity", "npc_has_dexterity",
"u_has_intelligence", "npc_has_intelligence", "u_has_perception", "npc_has_perception",
Expand Down Expand Up @@ -130,6 +130,7 @@ struct conditional_t {
void set_is_on_terrain_with_flag( const JsonObject &jo, const std::string &member,
bool is_npc = false );
void set_is_in_field( const JsonObject &jo, const std::string &member, bool is_npc = false );
void set_has_wielded_with_weapon_category( const JsonObject &jo, const std::string &member, bool is_npc = false );
Kenshut marked this conversation as resolved.
Show resolved Hide resolved
void set_one_in_chance( const JsonObject &jo, const std::string &member );
void set_query( const JsonObject &jo, const std::string &member, bool is_npc = false );
void set_x_in_y_chance( const JsonObject &jo, std::string_view member );
Expand Down
3 changes: 3 additions & 0 deletions src/talker.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ class talker
virtual double armor_at( damage_type_id &, bodypart_id & ) const {
return 0;
}
virtual bool wielded_with_weapon_category( const weapon_category_id & ) const {
return false;
}
virtual bool worn_with_flag( const flag_id &, const bodypart_id & ) const {
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions src/talker_character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#include "character_martial_arts.h"
#include "effect.h"
#include "item.h"
#include "itype.h"
#include "magic.h"
#include "npc.h"
#include "npctalk.h"
#include "pimpl.h"
#include "player_activity.h"
#include "point.h"
Expand Down Expand Up @@ -654,6 +656,12 @@ bool talker_character_const::wielded_with_flag( const flag_id &flag ) const
return me_chr_const->get_wielded_item() && me_chr_const->get_wielded_item()->has_flag( flag );
}

bool talker_character_const::wielded_with_weapon_category( const weapon_category_id &w_cat ) const
{
return me_chr_const->get_wielded_item() &&
me_chr_const->get_wielded_item()->typeId()->weapon_category.count( w_cat ) > 0;
}

bool talker_character_const::has_item_with_flag( const flag_id &flag ) const
{
return me_chr_const->has_item_with_flag( flag );
Expand Down
1 change: 1 addition & 0 deletions src/talker_character.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class talker_character_const: public talker_cloner<talker_character_const>

bool worn_with_flag( const flag_id &flag, const bodypart_id &bp ) const override;
bool wielded_with_flag( const flag_id &flag ) const override;
bool wielded_with_weapon_category( const weapon_category_id &w_cat ) const override;
bool has_item_with_flag( const flag_id &flag ) const override;
int item_rads( const flag_id &flag, aggregate_type agg_func ) const override;

Expand Down
Loading