Skip to content

Commit

Permalink
Merge pull request #30150 from mlangsdorf/faction_zones_take_2
Browse files Browse the repository at this point in the history
NPCs: support faction tagged zones
  • Loading branch information
kevingranade authored May 12, 2019
2 parents 654defd + add93c3 commit 3c24c53
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 128 deletions.
43 changes: 43 additions & 0 deletions data/json/mapgen/refugee_center.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
"......_______,,_______ssssssssssssssssssssssssssssss,,,,,,,,,,,,,,,,ssssssssssssssssssssssssssssss_______,,_______......"
],
"palettes": [ "evac_center" ],
"place_zones": [
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 24, 47 ], "y": [ 23, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 48, 71 ], "y": [ 23, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 24, 47 ], "y": [ 23, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 48, 71 ], "y": [ 23, 23 ] }
],
"place_vehicles": [
{ "vehicle": "schoolbus", "x": 32, "y": 18, "chance": 75, "rotation": 0 },
{ "vehicle": "car", "x": 48, "y": 23, "chance": 75, "rotation": 270 }
Expand Down Expand Up @@ -73,6 +79,20 @@
"......_______,,_______sss....#########t+ S# ########### ###########==#S +t##########....sss_______,,_______......"
],
"palettes": [ "evac_center" ],
"place_zones": [
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 48, 68 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 48, 68 ], "y": [ 0, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "free_merchants", "x": [ 69, 71 ], "y": [ 2, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "free_merchants", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "wasteland_scavengers", "x": [ 69, 71 ], "y": [ 2, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "wasteland_scavengers", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "old_guard", "x": [ 69, 71 ], "y": [ 2, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "old_guard", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "lobby_beggars", "x": [ 69, 71 ], "y": [ 2, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "lobby_beggars", "x": [ 72, 95 ], "y": [ 0, 23 ] }
],
"place_vehicles": [
{ "vehicle": "schoolbus", "x": 21, "y": 13, "chance": 75, "rotation": 270 },
{ "vehicle": "flatbed_truck", "x": 98, "y": 18, "chance": 75, "rotation": 90 }
Expand Down Expand Up @@ -151,6 +171,17 @@
"......_______,,________sss.........##### S# # 6V 2 2 V6 v# #S #####.........sss_________,,_______......"
],
"palettes": [ "evac_center" ],
"place_zones": [
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 48, 71 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 48, 71 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "free_merchants", "x": [ 24, 32 ], "y": [ 3, 20 ] },
{ "type": "NPC_NO_INVESTIGATE", "faction": "wasteland_scavengers", "x": [ 24, 32 ], "y": [ 3, 20 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "lobby_beggars", "x": [ 51, 68 ], "y": [ 21, 23 ] }
],
"items": {
"D": { "item": "trash", "chance": 60, "repeat": [ 1, 3 ] },
"L": { "item": "cleaning", "chance": 80, "repeat": [ 2, 6 ] },
Expand Down Expand Up @@ -212,6 +243,18 @@
"......_______,,_______ssss...............................ssssss...............................ssss_______,,_______......"
],
"palettes": [ "evac_center" ],
"place_zones": [
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 48, 71 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "free_merchants", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 24, 47 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 48, 71 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "wasteland_scavengers", "x": [ 72, 95 ], "y": [ 0, 23 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "old_guard", "x": [ 29, 47 ], "y": [ 2, 19 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "old_guard", "x": [ 48, 59 ], "y": [ 2, 19 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "old_guard", "x": [ 48, 48 ], "y": [ 0, 0 ] },
{ "type": "NPC_INVESTIGATE_ONLY", "faction": "lobby_beggars", "x": [ 51, 68 ], "y": [ 0, 4 ] }
],
"items": {
"@": { "item": "bed", "chance": 80 },
"D": { "item": "trash", "chance": 60, "repeat": [ 1, 3 ] },
Expand Down
19 changes: 19 additions & 0 deletions data/json/npcs/factions.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@
"cult": 0,
"description": "A conglomeration of entrepreneurs and businessmen that stand together to hammer-out an existence through trade and industry."
},
{
"type": "faction",
"id": "lobby_beggars",
"name": "The Beggars in the Lobby",
"likes_u": 0,
"respects_u": 0,
"known_by_u": false,
"size": 5,
"power": 0,
"combat_ability": 0,
"food_supply": 1152,
"wealth": 100,
"good": 1,
"strength": 0,
"sneak": 0,
"crime": -1,
"cult": 0,
"description": "A collection of mentally and physically disadvantaged survivors who beg for food in the Evac Center lobby."
},
{
"type": "faction",
"id": "tacoma_commune",
Expand Down
10 changes: 5 additions & 5 deletions data/json/npcs/npc.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
"attitude": 0,
"mission": 7,
"chat": "TALK_REFUGEE_BEGGAR_1",
"faction": "wasteland_scavengers"
"faction": "lobby_beggars"
},
{
"type": "npc",
Expand All @@ -434,7 +434,7 @@
"attitude": 0,
"mission": 7,
"chat": "TALK_REFUGEE_BEGGAR_2",
"faction": "wasteland_scavengers"
"faction": "lobby_beggars"
},
{
"type": "npc",
Expand All @@ -447,7 +447,7 @@
"attitude": 0,
"mission": 7,
"chat": "TALK_REFUGEE_BEGGAR_3",
"faction": "wasteland_scavengers"
"faction": "lobby_beggars"
},
{
"type": "npc",
Expand All @@ -460,7 +460,7 @@
"attitude": 0,
"mission": 7,
"chat": "TALK_REFUGEE_BEGGAR_4",
"faction": "wasteland_scavengers"
"faction": "lobby_beggars"
},
{
"type": "npc",
Expand All @@ -473,7 +473,7 @@
"attitude": 0,
"mission": 7,
"chat": "TALK_REFUGEE_BEGGAR_5",
"faction": "wasteland_scavengers"
"faction": "lobby_beggars"
},
{
"type": "npc",
Expand Down
7 changes: 7 additions & 0 deletions doc/MAPGEN.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
* 2.5.17 "sealed_item"
* 2.5.18 "graffiti"
* 2.6.19 "translate_ter"
* 2.6.20 "zones"
* 2.6 "rotation"
* 3 update_mapgen
* 3.1 overmap tile specification
Expand Down Expand Up @@ -698,6 +699,12 @@ normal mapgen, but it is useful for setting a baseline with update_mapgen.
- "from": (required, string) the terrain id of the terrain to be transformed
- "to": (required, string) the terrain id that the from terrain will transformed into

### 2.5.20 "zones"
Places a zone for an NPC faction. NPCs in the faction will use the zone to influence the AI.
- "type": (required, string) must be one of NPC_RETREAT, NPC_NO_INVESTIGATE, or NPC_INVESTIGATE_ONLY. NPCs will prefer to retreat towards NPC_RETREAT zones. They will not move to the see the source of unseen sounds coming from NPC_NO_INVESTIGATE zones. They will not move to the see the source of unseen sounds coming from outside NPC_INVESTIGATE_ONLY zones.
- "faction": (required, string) the faction id of the NPC faction that will use the zone.
- "name": (optional, string) the name of the zone.

# 2.7 "rotation"
Rotates the generated map after all the other mapgen stuff has been done. The value can be a single integer or a range (out of which a value will be randomly chosen). Example:
```JSON
Expand Down
Loading

0 comments on commit 3c24c53

Please sign in to comment.