Implement TargetingPolicy, Cover can only target other allies
This commit is contained in:
parent
611601934d
commit
3e0004d4cb
21 changed files with 151 additions and 26 deletions
16
Assets/Battle/Targeting/OtheHeroTargetPolicy.cs
Normal file
16
Assets/Battle/Targeting/OtheHeroTargetPolicy.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class OtherHeroTargetPolicy: TargetingPolicy
|
||||
{
|
||||
private BattleParticipant owner;
|
||||
|
||||
public OtherHeroTargetPolicy(BattleParticipant owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public override bool CanTarget(BattleParticipant participant) {
|
||||
return participant.IsHero() && participant != this.owner;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue