summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test/SaionjiScript_Ability.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-02 19:53:12 +0800
committerchai <chaifix@163.com>2020-11-02 19:53:12 +0800
commit3708d0a07ce43c3d98a0171eacfa9c370c873f96 (patch)
tree728f72bd8e6c464c6f56db7b08755031f685c45c /Assets/Scripts/Test/SaionjiScript_Ability.cs
parent64061aee5d7849f348f07b78fc3f96ad7555c147 (diff)
*受击
Diffstat (limited to 'Assets/Scripts/Test/SaionjiScript_Ability.cs')
-rw-r--r--Assets/Scripts/Test/SaionjiScript_Ability.cs45
1 files changed, 25 insertions, 20 deletions
diff --git a/Assets/Scripts/Test/SaionjiScript_Ability.cs b/Assets/Scripts/Test/SaionjiScript_Ability.cs
index 8934b5da..d8233f56 100644
--- a/Assets/Scripts/Test/SaionjiScript_Ability.cs
+++ b/Assets/Scripts/Test/SaionjiScript_Ability.cs
@@ -4,10 +4,6 @@ using UnityEngine;
public partial class SaionjiScript : Avatar
{
- /// <summary>
- /// ability system
- /// </summary>
- AbilitySystem m_AbilitySystem = new AbilitySystem();
ConditionBase Not(ConditionBase cond)
{
@@ -19,7 +15,6 @@ public partial class SaionjiScript : Avatar
return new ConditionAnd(c1, c2);
}
-
ConditionBase Ands(params ConditionBase[] cond)
{
List<ConditionBase> conditions = new List<ConditionBase>();
@@ -71,13 +66,21 @@ public partial class SaionjiScript : Avatar
AttackAbilityConfig config;
- //招式会绑定一个motion
+ //招式会绑定一个motion
+ HitDefination hitDef = new HitDefination
+ {
+ };
AttackAbility attk1 = new AttackAbility(animator, Anim_LightAttack1, m_Body);
- AttackAbility attk2 = new AttackAbility(animator, Anim_LightAttack2, m_Body);
- AttackAbility attk3 = new AttackAbility(animator, Anim_LightAttack3, m_Body);
- AttackAbility attk4 = new AttackAbility(animator, Anim_LightAttack4, m_Body);
- AttackAbility attk5 = new AttackAbility(animator, Anim_LightAttack5, m_Body);
- AttackAbility attkRush = new AttackAbility(animator, Anim_LightAttackRush, m_Body);
+ attk1.AddHitDefination(hitDef);
+ AttackAbility attk2 = new AttackAbility(animator, Anim_LightAttack2, m_Body);
+ attk2.AddHitDefination(hitDef);
+ AttackAbility attk3 = new AttackAbility(animator, Anim_LightAttack3, m_Body);
+ attk3.AddHitDefination(hitDef);
+ AttackAbility attk4 = new AttackAbility(animator, Anim_LightAttack4, m_Body);
+ attk4.AddHitDefination(hitDef);
+ AttackAbility attk5 = new AttackAbility(animator, Anim_LightAttack5, m_Body);
+ attk5.AddHitDefination(hitDef);
+ AttackAbility attkRush = new AttackAbility(animator, Anim_LightAttackRush, m_Body);
config = new AttackAbilityConfig() {
animator = this.animator,
@@ -164,7 +167,7 @@ public partial class SaionjiScript : Avatar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// idle ability
- trigger = new Trigger(condUpCmd, toJump) ;
+ trigger = new Trigger(condTriangleCmd, toJump) ;
idle.AddTrigger(trigger);
trigger = new Trigger(And(condTowardRight, condDRC), new List<ActionBase> { wipeCmdRecord, switchToSuperKick });
idle.AddTrigger(trigger);
@@ -187,10 +190,12 @@ public partial class SaionjiScript : Avatar
idle.AddTrigger(triggerTurnRight);
idle.AddTrigger(triggerTurnLeft);
- // move ability
- trigger = new Trigger(Or(Ands(condRightButtonHold, condTowardRight, condUpCmd), Ands(condLeftButtonHold, condTowardLeft, condUpCmd)), toJumpForward);
- move.AddTrigger(trigger);
- trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List<ActionBase> { wipeCmdRecord, switchToDash, });
+ // move ability
+ //trigger = new Trigger(Or(Ands(condRightButtonHold, condTowardRight, condTriangleCmd), Ands(condLeftButtonHold, condTowardLeft, condTriangleCmd)), toJumpForward);
+ //move.AddTrigger(trigger);
+ trigger = new Trigger(condTriangleCmd, toJump);
+ move.AddTrigger(trigger);
+ trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List<ActionBase> { wipeCmdRecord, switchToDash, });
move.AddTrigger(trigger);
trigger = new Trigger(And(condTowardLeft, And(condLeftCmd, condLeft2Cmd)), new List<ActionBase> { wipeCmdRecord, switchToDash });
move.AddTrigger(trigger);
@@ -217,8 +222,8 @@ public partial class SaionjiScript : Avatar
jump.AddTrigger(trigger);
trigger = new Trigger(And(condLeftButtonHold, condCheckJump), new List<ActionBase> { towardLeft, new ActionSetVelocityX(m_Body,-4) }, TriggerOnlyOnce.Off, TriggerSwallow.Off);
jump.AddTrigger(trigger);
- trigger = new Trigger(Ands(condCheckJump, Not(condRightButtonHold), Not(condLeftButtonHold)), new ActionSetVelocityX(m_Body, 0), TriggerOnlyOnce.Off, TriggerSwallow.Off);
- jump.AddTrigger(trigger);
+ //trigger = new Trigger(Ands(condCheckJump, Not(condRightButtonHold), Not(condLeftButtonHold)), new ActionSetVelocityX(m_Body, 0), TriggerOnlyOnce.Off, TriggerSwallow.Off);
+ //jump.AddTrigger(trigger);
trigger = new Trigger(condJumpOnGround, new ActionSetVelocity(m_Body, Vector3.zero), TriggerOnlyOnce.On, TriggerSwallow.Off);
jump.AddTrigger(trigger);
trigger = new Trigger(Ands(new ConditionJumpDone(jump, 0.4f), condJumpOnGround, Or(condRightButtonHold, condLeftButtonHold)), switchToMove);
@@ -244,8 +249,8 @@ public partial class SaionjiScript : Avatar
attk1.AddTrigger(trigger);
attk1.AddTrigger(triggerTurnRight);
attk1.AddTrigger(triggerTurnLeft);
- trigger = new Trigger(condIsHit, new ActionLog("hit!!!"));
- attk1.AddLateTrigger(trigger);
+ //trigger = new Trigger(condIsHit, new ActionLog("hit!!!"));
+ //attk1.AddLateTrigger(trigger);
//ConditionMotionRange condAttkRushGhostRange = new ConditionMotionRange(animator, 0f, 0.8f);
//trigger = new Trigger(condAttkRushGhostRange, enableGhost, false);