Skip to content

Commit df23c60

Browse files
committed
monster shoot arrows
1 parent 7540f36 commit df23c60

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

l2-unity/Assets/Scripts/Animation/Controller/NewMonsterAnimationController.cs

+15-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public override void SetWalkSpeed(float value)
4444
public override void Jump() { }
4545
public override void Attack()
4646
{
47-
Debug.LogWarning("Monster attack!");
4847
if (PlayAnimation((int)MonsterAnimationEvent.atk01))
4948
{
5049
_animancerState.EffectiveSpeed = _atkSpdMultiplier;
@@ -53,8 +52,22 @@ public override void Attack()
5352
{
5453
_animancerState.Events.Add(AudioHandler.AtkRatio, () => AudioHandler.PlayAtkSound());
5554

55+
if (_entityReferenceHolder.Gear.WeaponType == WeaponType.bow)
56+
{
57+
_animancerState.Events.Add(_nockArrowRatio, () =>
58+
{
59+
_entityReferenceHolder.Combat.NockArrow();
60+
AudioHandler.PlayBowBendSound();
61+
});
62+
63+
_animancerState.Events.Add(_shootArrowRatio, () =>
64+
{
65+
_entityReferenceHolder.Combat.ShootArrow();
66+
AudioHandler.PlayArrowShootSound();
67+
});
68+
}
69+
5670
_animancerState.Events.OnEnd += Wait;
57-
//TODO: Detect if monster has a bow ?
5871
}
5972
}
6073
}
@@ -79,7 +92,6 @@ public override void Run()
7992

8093
public override void Wait()
8194
{
82-
Debug.LogWarning("Monster Wait!");
8395
if (AtkWait())
8496
{
8597
return;

l2-unity/Assets/Scripts/Audio/Animation/MonsterAudioHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public override void PlaySound(EntitySoundEvent soundEvent)
4343

4444
public void PlayAtkSound()
4545
{
46-
Debug.LogWarning("Monster Play atk sound");
4746
PlaySound(EntitySoundEvent.Atk);
4847
}
4948

0 commit comments

Comments
 (0)