Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

`inherits_flags`. Probably partially malfunctioning?

Open IdleSol opened this issue 1 year ago • 0 comments

Describe the bug

My expectation.

  1. There is a test item N1, with any flag
  2. There is a test item N2, with a pocket for which the following is specified: "inherits_flags": true
  3. We place item N1 in the pocket of item N2. Item N2 gets all the flags from item N1.

But for the flag IS_UPS this does not happen. Maybe for some other flags. But definitely not for all of them.

For testing purposes, a helmet is created that is powered by UPS. Armor that should act as UPS if an item with IS_UPS flag is placed in the armor pocket. Additionally to the description of the item the flag Watch is added.

Armor Description. Pocket without test item. 1

Description of the test item. 2

Description of the armor, in the pocket of which the test item is placed. 3

Note that the line that the item shows the time has been added. But there is no line about it being a UPS.

Trying to activate the helmet 4

JSON
[
  {
    "id": "test_flag_item",
    "type": "TOOL",
    "name": { "str": "test flag item" },
    "description": "test",
    "weight": "50 g",
    "volume": "30 ml",
    "longest_side": "1 cm",
    "price": "600 USD",
    "price_postapoc": "1 USD",
    "material": [ "ceramic" ],
    "symbol": ",",
    "color": "dark_gray",
    "flags": [ "IS_UPS", "WATCH" ]
  },

  {
    "id": "TEST_helmet",
    "type": "TOOL_ARMOR",
    "category": "armor",
    "name": { "str": "TEST helmet (off)" },
    "description": "test",
    "weight": "1600 g",
    "volume": "2050 ml",
    "longest_side": "28 cm",
    "price": "0 USD",
    "price_postapoc": "100 USD",
    "material": [ "lycra" ],
    "symbol": "[",
    "color": "blue",
    "looks_like": "flight_helmet",
    "ammo": "battery",
    "use_action": [
      {
        "type": "transform",
        "menu_text": "Turn on",
        "target": "TEST_helmet_on",
        "active": true,
        "need_charges": 1,
        "need_charges_msg": "The charger's battery is empty.",
        "moves": 100
      }
    ],
    "armor": [
      {
        "covers": [ "head" ],
        "material": [
          { "type": "lycra", "covered_by_mat": 100, "thickness": 1 }
        ],
        "encumbrance": 25,
        "coverage": 100,
        "layers": [ "SKINTIGHT", "NORMAL" ]
      }
    ],
    "warmth": 15,
    "environmental_protection": 5,
    "flags": [ "VARSIZE", "USE_UPS", "BLIND" ]
  },
  
  {
    "id": "TEST_helmet_on",
    "type": "TOOL_ARMOR",
    "name": { "str": "TEST helmet (on)" },
    "description": "It's a sturdy and comfortable helmet. Equipped with an integrated augmented reality system",
    "copy-from": "TEST_helmet",
    "revert_to": "TEST_helmet",
    "power_draw": "14 W",
    "use_action": [
      {
        "type": "transform",
        "ammo_scale": 0,
        "menu_text": "Turn off",
        "target": "TEST_helmet",
        "moves": 100
      }
    ],
    "flags": [ "VARSIZE", "USE_UPS" ]
  },
  
  {
    "id": "TEST_armor",
    "type": "TOOL_ARMOR",
    "category": "armor",
    "name": { "str": "TEST armor" },
    "description": "TEST",
    "weight": "7900 g",
    "volume": "12700 ml",
    "longest_side": "50 cm",
    "price": "0 USD",
    "price_postapoc": "30 USD",
    "material": [ "lycra" ],
    "symbol": "[",
    "color": "blue",
    "looks_like": "ballistic_vest_heavy",
    "pocket_data": [
      { "pocket_type": "MAGAZINE", "rigid": true, "ammo_restriction": { "battery": 100 } },
      {
        "pocket_type": "CONTAINER",
        "volume_encumber_modifier": 0.0,
        "max_contains_volume": "300 ml",
        "max_contains_weight": "500 g",
        "max_item_length": "14 cm",
        "moves": 100,
        "inherits_flags": true,
        "item_restriction": [ "test_flag_item" ]
      }
    ],
    "armor": [
      {
        "covers": [ "torso" ],
        "material": [
          { "type": "lycra", "covered_by_mat": 100, "thickness": 1.0 }
        ],
        "encumbrance": 4,
        "coverage": 100,
        "cover_vitals": 90
      }
    ],
    "warmth": 15,
    "environmental_protection": 2,
    "flags": [ "OUTER", "STURDY" ]
  }
]

Attach save file

test.json

Steps to reproduce

  1. Download the file and add it to the game
  2. Spawning:
  • test flag item
  • TEST helmet (off)
  • TEST armor
  1. Remove all items from the character
  2. Wear a helmet and armor.
  3. Make sure you are blind and the time is not displayed.
  4. Put the test flag item in the armor pocket
  5. Make sure the armor description has changed
  6. Try to activate the helmet

Expected behavior

n/a

Screenshots

No response

Versions and configuration

cdda-windows-tiles-x64-2024-10-18-0902

Additional context

No response

IdleSol avatar Oct 18 '24 11:10 IdleSol