Skip to content

Commit

Permalink
Reorder priorities in MeleeCombatCompound (space-wizards#30066)
Browse files Browse the repository at this point in the history
Reordered MeleeCombatCompound to improve unpulling
  • Loading branch information
osjarw authored and sleepyyapril committed Jan 14, 2025
1 parent 6bcdd23 commit cf121be
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions Resources/Prototypes/NPCs/Combat/melee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,55 @@
- type: htnCompound
id: MeleeCombatCompound
branches:
# Pickup weapon if we don't have one.
- tasks:
- !type:HTNPrimitiveTask
operator: !type:UtilityOperator
proto: NearbyMeleeTargets
- !type:HTNCompoundTask
task: BeforeMeleeAttackTargetCompound

- type: htnCompound
id: BeforeMeleeAttackTargetCompound
branches:
- preconditions:
- !type:ActiveHandComponentPrecondition
components:
# Just serializer things
- type: MeleeWeapon
damage:
types:
Blunt: 0
invert: true
- !type:BuckledPrecondition
isBuckled: true
tasks:
- !type:HTNCompoundTask
task: PickupMeleeCompound
- !type:HTNPrimitiveTask
operator: !type:UnbuckleOperator
shutdownState: TaskFinished

- preconditions:
- !type:BuckledPrecondition
isBuckled: true
- !type:PulledPrecondition
isPulled: true
tasks:
- !type:HTNPrimitiveTask
operator: !type:UnbuckleOperator
shutdownState: TaskFinished
- !type:HTNPrimitiveTask
operator: !type:UnPullOperator
shutdownState: TaskFinished

- preconditions:
- !type:InContainerPrecondition
isInContainer: true
- !type:InContainerPrecondition
isInContainer: true
tasks:
- !type:HTNCompoundTask
task: EscapeCompound
- !type:HTNCompoundTask
task: EscapeCompound

# Pickup weapon if we don't have one.
- preconditions:
- !type:PulledPrecondition
isPulled: true
- !type:ActiveHandComponentPrecondition
components:
# Just serializer things
- type: MeleeWeapon
damage:
types:
Blunt: 0
invert: true
tasks:
- !type:HTNPrimitiveTask
operator: !type:UnPullOperator
shutdownState: TaskFinished
- !type:HTNCompoundTask
task: PickupMeleeCompound

# Melee combat (unarmed or otherwise)
- tasks:
- !type:HTNPrimitiveTask
operator: !type:UtilityOperator
proto: NearbyMeleeTargets
- !type:HTNCompoundTask
task: MeleeAttackTargetCompound

Expand Down

0 comments on commit cf121be

Please sign in to comment.