Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.8.1 / NPC / Roles / _Core / Tests / Combat / Test_Goblin_Attack.json

Test_Goblin_Attack

Server/NPC/Roles/_Core/Tests/Combat/Test_Goblin_Attack.json, 5.2 KB

Fields

FieldType
Typestring
Appearancestring
HotbarItemsarray[1]
StartStatestring
MotionControllerListarray[1]
TestTypestring
MaxHealthobject
Parametersobject
Instructionsarray[2]
NameTranslationKeystring

Source

{
  "Type": "Generic",
  "Appearance": "Goblin",
  "HotbarItems": [ "Weapon_Club_Crude" ],
  "StartState": "Idle",
  "MotionControllerList": [
    {
      "Type": "Walk",
      "MaxWalkSpeed": 3,
      "Gravity": 10,
      "MaxFallSpeed": 20,
      "Acceleration": 10
    }
  ],
  "TestType": "Normal",
  "MaxHealth": { "Compute": "MaxHealth" },
  "Parameters": {
    "MaxHealth": {
      "Value": 100,
      "Description": "Max health for the NPC"
    }
  },
  "Instructions": [
    {
      "Continue": true,
      "Instructions": [
        {
          "Sensor": {
            "Type": "State",
            "State": "Idle"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Any"
              },
              "BodyMotion": {
                "Type": "Nothing"
              }
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Blocked"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Any"
              },
              "Actions": [
                {
                  "Type": "Timeout",
                  "Delay": [ 2, 5 ],
                  "Action": {
                    "Type": "State",
                    "State": "Idle"
                  }
                }
              ],
              "BodyMotion": {
                "Type": "Wander",
                "MaxHeadingChange": 180
              }
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Attack"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Player",
                "Range": 10
              },
              "BodyMotion": {
                "Type": "Seek",
                "SlowDownDistance": 3,
                "StopDistance": 2,
                "AbortDistance": 15
              }
            },
            {
              "Sensor": {
                "Type": "Any"
              },
              "BodyMotion": {
                "Type": "Nothing"
              }
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Flee"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Player",
                "Range": 8
              },
              "BodyMotion": {
                "Type": "Flee",
                "SlowDownDistance": 9,
                "StopDistance": 10
              }
            },
            {
              "Sensor": {
                "Type": "Any"
              },
              "BodyMotion": {
                "Type": "Nothing"
              }
            }
          ]
        }
      ]
    },
    {
      "Instructions": [
        {
          "Sensor": {
            "Type": "State",
            "State": "Idle"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Player",
                "Range": 8
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Attack"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Any"
              },
              "Actions": [
                {
                  "Type": "Nothing"
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Attack"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Eval",
                "Expression": "health<50"
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Flee"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Eval",
                "Expression": "blocked"
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Blocked"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Player",
                "Range": 4,
                "Filters": [
                  {
                    "Type": "ViewSector",
                    "ViewSector": 90
                  }
                ]
              },
              "Actions": [
                {
                  "Type": "Timeout",
                  "Delay": [ 0, 0.5 ],
                  "Action": {
                    "Type": "Attack",
                    "Attack": "Root_NPC_Attack_Melee"
                  }
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Flee"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Eval",
                "Expression": "health>=90"
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Idle"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "NameTranslationKey": "server.npcRoles.Test_Goblin_Attack.name"
}