Hytale Asset ReferenceUnofficial
Versions / 0.6.0-pre.9 / EncounterManager / Example_Boss.json

Example_Boss

Server/EncounterManager/Example_Boss.json, 10.4 KB

Fields

FieldType
Classstring
Typestring
Debugstring
StartStatestring
Instructionsarray[1]

Source

{
  "Class": "EncounterManager",
  "Type": "Generic",
  "Debug": "DisplayState",
  "StartState": "Intro",
  "Instructions": [
    {
      "Sensor": {
        "Type": "Player",
        "Range": 30,
        "Collector": {
          "Type": "EncounterAudio"
        }
      },
      "Instructions": [
        {
          "Sensor": {
            "Type": "State",
            "State": "Intro"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "And",
                "Sensors": [
                  {
                    "Type": "Beacon",
                    "Range": 100,
                    "Message": "Boss_In_Position"
                  },
                  {
                    "Type": "Target",
                    "Range": 100,
                    "TargetSlot": "Boss"
                  }
                ]
              },
              "Actions": [
                {
                  "Type": "ChangeTargetRole",
                  "Role": "Test_Boss_Basic"
                },
                {
                  "Type": "StartEncounterMusic",
                  "MusicContainer": "Track_Encounter_Cave_Test"
                },
                {
                  "Type": "State",
                  "State": "Phase_1"
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Not",
                "Sensor": {
                  "Type": "Target",
                  "Range": 100,
                  "TargetSlot": "Boss"
                }
              },
              "ActionsBlocking": true,
              "Actions": [
                {
                  "Type": "PlaySound",
                  "SoundEventId": "SFX_Test_Blip_A"
                },
                {
                  "Type": "Timeout",
                  "Delay": [ 1, 1 ]
                },
                {
                  "Type": "TriggerSpawners",
                  "Count": 1,
                  "Range": 30,
                  "SpawnMarker": "Test_Boss_Marker",
                  "TargetSlot": "Boss",
                  "Rebind": true
                },
                {
                  "Type": "Timeout",
                  "Delay": [ 2, 2 ]
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Phase_1"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Target",
                "Range": 100,
                "TargetSlot": "Boss",
                "Filters": [
                  {
                    "Type": "Stat",
                    "StatTarget": "Value",
                    "RelativeTo": "Health",
                    "Stat": "Health",
                    "RelativeToTarget": "Max",
                    "ValueRange": [ 0.5, 1 ]
                  }
                ]
              },
              "Actions": [
                {
                  "Type": "Nothing"
                }
              ]
            },
            {
              "Continue": true,
              "Sensor": {
                "Type": "Target",
                "Range": 100,
                "TargetSlot": "Boss",
                "Filters": [
                  {
                    "Type": "Stat",
                    "StatTarget": "Value",
                    "RelativeTo": "Health",
                    "Stat": "Health",
                    "RelativeToTarget": "Max",
                    "ValueRange": [ 0, 0.49 ]
                  }
                ]
              },
              "Actions": [
                {
                  "Type": "ChangeTargetRole",
                  "Role": "Test_Boss_Basic_Wander"
                }
              ]
            },
            {
              "ActionsBlocking": true,
              "Actions": [
                {
                  "Type": "PlaySound",
                  "SoundEventId": "SFX_Test_Blip_A"
                },
                {
                  "Type": "SetEncounterAudioState",
                  "AudioState": "AudioState_Test_EncounterIntensity",
                  "Value": "Climax",
                  "FadeMs": 1500
                },
                {
                  "Type": "State",
                  "State": "Phase_2"
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Phase_2"
          },
          "Instructions": [
            {
              "Continue": true,
              "Sensor": {
                "Type": "Mob",
                "Once": true,
                "Range": 100,
                "MultiTarget": true,
                "Filters": [
                  {
                    "Type": "Attitude",
                    "Attitudes": [ "Friendly" ]
                  }
                ]
              },
              "Actions": [
                {
                  "Type": "ForEach",
                  "Actions": [
                    {
                      "Type": "SpawnParticles",
                      "PositionSource": "Sensor",
                      "ParticleSystem": "Explosion_Medium"
                    }
                  ]
                }
              ]
            },
            {
              "Continue": true,
              "Sensor": {
                "Type": "Player",
                "Range": 100,
                "MultiTarget": true
              },
              "Actions": [
                {
                  "Type": "Sequence",
                  "Blocking": true,
                  "Actions": [
                    {
                      "Type": "Timeout",
                      "Delay": [ 5, 5 ]
                    },
                    {
                      "Type": "ProjectToGround",
                      "Actions": [
                        {
                          "Type": "ForEach",
                          "Actions": [
                            {
                              "Type": "SpawnParticles",
                              "PositionSource": "Sensor",
                              "ParticleSystem": "Explosion_Medium"
                            }
                          ]
                        },
                        {
                          "Type": "AdjustPosition",
                          "Offset": [ 0, 10, 0 ],
                          "Actions": [
                            {
                              "Type": "ForEach",
                              "Actions": [
                                {
                                  "Type": "SpawnInteraction",
                                  "PositionSource": "Sensor",
                                  "Interaction": "Test_Encounter_Projectile",
                                  "OrientationSource": "Absolute",
                                  "Pitch": -90,
                                  "Delay": [ 2, 2 ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "Continue": true,
              "Sensor": {
                "Type": "Points",
                "Tag": "arrow",
                "Range": 100
              },
              "Actions": [
                {
                  "Type": "Sequence",
                  "Blocking": true,
                  "Actions": [
                    {
                      "Type": "Timeout",
                      "Delay": [ 5, 5 ]
                    },
                    {
                      "Type": "ForEach",
                      "TargetCount": [ 4, 4 ],
                      "Actions": [
                        {
                          "Type": "ProjectToGround",
                          "Actions": [
                            {
                              "Type": "SpawnParticles",
                              "PositionSource": "Sensor",
                              "ParticleSystem": "Explosion_Medium"
                            }
                          ]
                        },
                        {
                          "Type": "SpawnInteraction",
                          "PositionSource": "Sensor",
                          "OrientationSource": "UseSensor",
                          "Interaction": "Test_Encounter_Projectile",
                          "Delay": [ 2, 2 ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "Sensor": {
                "Type": "Target",
                "Range": 100,
                "TargetSlot": "Boss"
              },
              "Actions": [
                {
                  "Type": "Nothing"
                }
              ]
            },
            {
              "Actions": [
                {
                  "Type": "PlaySound",
                  "SoundEventId": "SFX_Test_Blip_A"
                },
                {
                  "Type": "ReleaseTarget",
                  "TargetSlot": "Boss"
                },
                {
                  "Type": "State",
                  "State": "BossDead"
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "BossDead"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Not",
                "Sensor": {
                  "Type": "Mob",
                  "Range": 100,
                  "Filters": [
                    {
                      "Type": "Attitude",
                      "Attitudes": [ "Friendly" ]
                    }
                  ]
                }
              },
              "Actions": [
                {
                  "Type": "StopEncounterMusic"
                },
                {
                  "Type": "State",
                  "State": "Complete"
                }
              ]
            }
          ]
        },
        {
          "Sensor": {
            "Type": "State",
            "State": "Complete"
          },
          "Instructions": [
            {
              "Sensor": {
                "Type": "Beacon",
                "Message": "Restart"
              },
              "Actions": [
                {
                  "Type": "State",
                  "State": "Intro"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}