فهرست منبع

boss切换形态0.5

SZAND\msx_2 2 ماه پیش
والد
کامیت
0b54516983

+ 75 - 88
ActionTowerDefense/Assets/Resources/Prefab/Boss/WaterSprite/Boss_Braid.prefab

@@ -61,7 +61,6 @@ MonoBehaviour:
   canBreakWall: 0
   wallBrealNum: 10
   isShoot: 0
-  type: 0
   owner: {fileID: 0}
   isSingleAttack: 0
   cantSingleAttack: 0
@@ -72,6 +71,7 @@ MonoBehaviour:
     attackDir: {x: 0, y: 0, z: 0}
     effect: {fileID: 0}
     attackEffect: 
+    attackMethod_Type: 0
     floatState:
       time: 0
       upTime: {x: 0, y: 0}
@@ -112,7 +112,6 @@ MonoBehaviour:
       rate: 0
     sustainedInjury:
       damage: 0
-    isDemSummon: 0
   force: {x: 0, y: 0, z: 0}
   changeHurt: 0
   repelValue: 0
@@ -229,6 +228,7 @@ Transform:
   - {fileID: 16214314734099187}
   - {fileID: 16214313449006094}
   - {fileID: 16214315325599451}
+  - {fileID: 3983394102083973817}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -273,8 +273,6 @@ MonoBehaviour:
   meshRenderer: {fileID: 0}
   ani: {fileID: 16214314406868123}
   totalDieKeepTime: 13.066668
-  totalAttack_summonTime: 0.5
-  totalAttack_marchTime: 0.5
   showInjuryNum: 1
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   injuryNumTextSummon: {fileID: 6467251191553420251, guid: 71b4c570c9e403d429846b71878a20c4, type: 3}
@@ -363,13 +361,6 @@ MonoBehaviour:
   maxInterval: 3
   curInterval: 0
   bossState: 0
-  totalPatience: 1000
-  uiPatience: {fileID: 16214313700123516}
-  delPorpotation:
-  - 0.8
-  - 0.7
-  - 0.6
-  - 0.5
   weakTime: 6
   bossRoom: {fileID: 4836784678684123925, guid: ba1fd02c9b0dc5b4db99b52f83acc512, type: 3}
   toBossNeedHP: 100
@@ -393,6 +384,10 @@ MonoBehaviour:
       weight: 2
   - category: 2
     attacks: []
+  polliNum: 100
+  pws: {fileID: 566765055176838525}
+  changeStateHPPer: 500000003200000014000000
+  polliTime: 5
 --- !u!114 &16214313399265844
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -405,78 +400,16 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 510b62b1c3fa05644965b46b53285aa3, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  attackKeys: []
-  keyTimes: []
-  attackTime: 0
-  attackKeyCount: 0
-  nextStartKeyTime: 0
-  nextEndKeyTime: 0
-  curKeyNum: 0
-  attackType: 2
   attackInterval: 0
-  curDamage: 0
-  canHitFly: 0
-  attackInfo:
-    attackValue: 0
-    damage: 0
-    attackDir: {x: 0, y: 0, z: 0}
-    effect: {fileID: 0}
-    attackEffect: 
-    floatState:
-      time: 0
-      upTime: {x: 0, y: 0}
-      backSpeed: {x: 0, y: 0}
-      rotateSpeed: {x: 0, y: 0}
-      height: {x: 0, y: 0}
-      ControlOrder: 0
-    blowUp:
-      directionType: 0
-      dir: {x: 0, y: 0, z: 0}
-      dirRandom: {x: 0, y: 0, z: 0}
-      force: 0
-      time: 0
-      haveLandingDamage: 0
-      landingDamageRate: 0
-      ControlOrder: 0
-    shotDown:
-      directionType: 0
-      dir: {x: 0, y: 0, z: 0}
-      dirRandom: {x: 0, y: 0, z: 0}
-      force: 0
-      time: 0
-      haveLandingDamage: 0
-      landingDamage: 0
-      ControlOrder: 0
-    weak:
-      time: 0
-      ControlOrder: 0
-    armorPiercing:
-      rate: 0
-    vulnerable:
-      rate: 0
-      time: 0
-    stackingWounds:
-      damage: 0
-      time: 0
-    changeDamage:
-      rate: 0
-    sustainedInjury:
-      damage: 0
-    isDemSummon: 0
   addAttackEffect: {fileID: 0}
-  skill: {fileID: 0}
-  attackDistance: 0
-  attackTrigger: {fileID: 0}
   isAttackTriggerOn: 0
-  bulletPrefab: {fileID: 0}
-  shootPos: []
-  shootTrack: 0
-  shootAlwaysTrack: 0
   targetTypes: 0300000001000000
-  beTargetCharacter: []
-  attackMethod: []
+  attackSummonId: 0
+  attackMarchId: 0
+  summonTime: []
+  attackMethod_summon: []
+  attackMethod_march: []
   curAttackMethod:
-    id: 0
     attackName: 
     attackType: 0
     attackInfo:
@@ -485,6 +418,7 @@ MonoBehaviour:
       attackDir: {x: 0, y: 0, z: 0}
       effect: {fileID: 0}
       attackEffect: 
+      attackMethod_Type: 0
       floatState:
         time: 0
         upTime: {x: 0, y: 0}
@@ -525,16 +459,13 @@ MonoBehaviour:
         rate: 0
       sustainedInjury:
         damage: 0
-      isDemSummon: 0
     attackTrigger: {fileID: 0}
+    needToChange: 0
     attackDistance: 0
     maxAttackDis: 0
     minAttackDis: 0
-    needToChange: 0
     searchMode: 0
-    targetTypes: 
     canHitFly: 0
-    armorPiercing: 0
     bulletPrefab: {fileID: 0}
     shootPos: []
     maxUpAngle: 0
@@ -542,6 +473,14 @@ MonoBehaviour:
     shootTrack: 0
     shootAlwaysTrack: 0
     skill: {fileID: 0}
+  attackKeys: []
+  keyTimes: []
+  attackTime: 0
+  attackKeyCount: 0
+  nextStartKeyTime: 0
+  nextEndKeyTime: 0
+  curKeyNum: 0
+  beTargetCharacter: []
   umbrellaPrefab: {fileID: 5733499164336919437, guid: 203a26064d258d74683c81fbfee9f135, type: 3}
   umbrellaInstance: {fileID: 0}
   umbrellaOrigPos: {fileID: 16214313865630205}
@@ -662,7 +601,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &16214313700123517
 RectTransform:
   m_ObjectHideFlags: 0
@@ -1061,6 +1000,7 @@ MonoBehaviour:
     attackDir: {x: 0, y: 0, z: 0}
     effect: {fileID: 0}
     attackEffect: 
+    attackMethod_Type: 0
     floatState:
       time: 0
       upTime: {x: 0, y: 0}
@@ -1101,7 +1041,6 @@ MonoBehaviour:
       rate: 0
     sustainedInjury:
       damage: 0
-    isDemSummon: 0
   attributeTime: 0
   floatingState: 0
   hitState: 0
@@ -1109,8 +1048,8 @@ MonoBehaviour:
   decelerationRatioX: 2
   decelerationRatioY: 15
   rotateCenterHeight: 1
-  startFlyAngle: 15
-  flyingRotateSpeedRange: {x: 15, y: 45}
+  startFlyAngle: 0
+  flyingRotateSpeedRange: {x: 0, y: 0}
   compressionDegree: 0.8
   compressionSpeed: {x: 0.2, y: 0.4}
   jumpVel: 5
@@ -1147,6 +1086,7 @@ MonoBehaviour:
     attackDir: {x: 0, y: 0, z: 0}
     effect: {fileID: 0}
     attackEffect: 
+    attackMethod_Type: 0
     floatState:
       time: 0
       upTime: {x: 0, y: 0}
@@ -1187,7 +1127,6 @@ MonoBehaviour:
       rate: 0
     sustainedInjury:
       damage: 0
-    isDemSummon: 0
   attackFromData: {fileID: 0}
   hitStunTime: 0
   canHitStun: 0
@@ -1629,7 +1568,6 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   rb: {fileID: 0}
   moveCharacter: {fileID: 0}
-  canOnGiant: 0
   haveGravity: 1
   trigGroundList: []
   platform: {fileID: 0}
@@ -1735,3 +1673,52 @@ MonoBehaviour:
   m_BlockingMask:
     serializedVersion: 2
     m_Bits: 16777215
+--- !u!1 &2439495398494907273
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 3983394102083973817}
+  - component: {fileID: 566765055176838525}
+  m_Layer: 16
+  m_Name: pollishot
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &3983394102083973817
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2439495398494907273}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 16214313399265851}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &566765055176838525
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2439495398494907273}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 08adf4cba43029d4bbc152067e9b3727, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  owner: {fileID: 0}
+  fishPrefab: {fileID: 8023685214597940645, guid: 601c6904a962d6243af8500d990dfd0b, type: 3}
+  num: 0
+  pos: {fileID: 0}
+  pollis: []

+ 10 - 9
ActionTowerDefense/Assets/Scripts/Boss/Boss.cs

@@ -55,7 +55,7 @@ public class Boss : MoveCharacter
     [FoldoutGroup("角色信息")]
     public BossState bossState;
     private BossState oldState;
-    [LabelText("耐力值")]
+    /*[LabelText("耐力值")]
     public int totalPatience;               //初始耐力值上限
     private int curPatience;                //当前耐力值
     public UIHP uiPatience;                 //耐力值的条
@@ -63,7 +63,7 @@ public class Boss : MoveCharacter
     public float[] delPorpotation;
     private int curDelPorID;
     private int curTotalPatience;           //当前耐力值上限
-    private bool noNeedChange;              //耐力值到底了,不用再缩减了
+    private bool noNeedChange;              //耐力值到底了,不用再缩减了*/
     [LabelText("虚弱时长")]
     public float weakTime;
     private float pastWeakTime;
@@ -125,11 +125,11 @@ public class Boss : MoveCharacter
         uiHp.Show(hp, totalHp);
         ChangeState(CharacterState.Idle);
         curInterval = Random.Range(minInterval, maxInterval);
-
+        /*
         //耐力条
         curTotalPatience = totalPatience;
         curPatience = curTotalPatience;
-        uiPatience.Show(curPatience, curTotalPatience);
+        uiPatience.Show(curPatience, curTotalPatience);*/
 
         //特殊状态脚本
         status = beHitTrigger.GetComponent<AttributeStatus>();
@@ -168,7 +168,8 @@ public class Boss : MoveCharacter
         {
             //有耐力值
             case BossState.normal:
-                //打耐力条
+                base.BeHit(attackInfo, attackFrom, damage);
+                /*//打耐力条
                 int damageData;
                 if (damage == -1)
                 {
@@ -185,7 +186,7 @@ public class Boss : MoveCharacter
                     curPatience = 0;
                     ChangeBossState(BossState.weak);
                 }
-                uiPatience.Show(curPatience, curTotalPatience);
+                uiPatience.Show(curPatience, curTotalPatience);*/
                 break;
             //耐力值破
             case BossState.weak:
@@ -228,7 +229,7 @@ public class Boss : MoveCharacter
             case BossState.weak:
                 //计算当前耐力值上限缩减程度
                 rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionY;
-                float curDelPor = delPorpotation[curDelPorID];
+                /*float curDelPor = delPorpotation[curDelPorID];
                 if (curDelPorID < delPorpotation.Length - 1)
                 {
                     curDelPorID++;
@@ -247,7 +248,7 @@ public class Boss : MoveCharacter
                 //将当前耐力值重置为新上限
                 curPatience = curTotalPatience;
                 //重置耐力条
-                uiPatience.Show(curPatience, curTotalPatience);
+                uiPatience.Show(curPatience, curTotalPatience);*/
                 //清空特殊状态
                 status.OutSpecialState();
                 //飞行
@@ -303,7 +304,7 @@ public class Boss : MoveCharacter
 
     public override void ChangeState(CharacterState newState)
     {
-        if (newState == state)
+        if (state == newState || newState == CharacterState.FramePause)
         {
             return;
         }

+ 80 - 1
ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/WaterSprite.cs

@@ -14,6 +14,12 @@ public class WaterSprite : Boss
         Rush,       //水面冲刺
     }
 
+    public enum BossStage
+    {
+        waterSprite,    //水诡形态
+        polliwog,       //蝌蚪形态
+    }
+
     [System.Serializable]
     public struct AttackAssignment
     {
@@ -37,13 +43,77 @@ public class WaterSprite : Boss
 
     [Header("移动")]
     private WaterSpriteJumpMove jumpMoveCS;
-    
+
+    [Header("变化形态")]
+    [LabelText("召唤蝌蚪的数量")]
+    public int polliNum;                //召唤蝌蚪的数量
+    [LabelText("召唤蝌蚪的脚本")]
+    public PolliwogShot pws;
+    private BossStage curBossStage;
+    [Range(1,100)]
+    [LabelText("血量到达多少百分比后切换蝌蚪形态")]
+    public int[] changeStateHPPer;      //每次转化形态的血量百分比预设
+    private int nextAimHP;              //下一个血量预设值
+    private int changeHPID;             //下一个是预设数组里的第几个
+    [LabelText("过多久从蝌蚪形态切回水诡形态")]
+    public float polliTime;
+    private float pastPoliTime;         //已经过去的蝌蚪时间
+
     public override void Init()
     {
         base.Init();
         attack = GetComponent<WaterSpriteAttackController>();
         jumpMoveCS = GetComponent<WaterSpriteJumpMove>();
         jumpMoveCS.ws = this;
+        nextAimHP = (int)(changeStateHPPer[changeHPID] / 100f * totalHp);
+        changeHPID++;
+    }
+
+    public void ChangeStage(BossStage bs)
+    {
+        if (bs == curBossStage)
+        {
+            return;
+        }
+        curBossStage = bs;
+        switch (bs)
+        {
+            case BossStage.waterSprite:
+                bodyTrans.gameObject.SetActive(false);
+                //在原地召唤一堆蝌蚪
+                pws.Shoot(polliNum, bodyTrans.position);
+                break;
+            case BossStage.polliwog:
+                //所有蝌蚪消失
+                pws.AllPoliDie();
+                bodyTrans.gameObject.SetActive(true);
+                break;
+            default:
+                break;
+        }
+    }
+
+    private void OnStage()
+    {
+        switch (curBossStage)
+        {
+            case BossStage.polliwog:
+                print(1);
+                pastPoliTime += Time.deltaTime;
+                if (pastPoliTime >= polliTime)
+                {
+                    ChangeStage(BossStage.waterSprite);
+                    pastPoliTime = 0;
+                    print(2);
+                }
+                break;
+        }
+    }
+
+    public override void Update()
+    {
+        base.Update();
+        OnStage();
     }
 
     //步步生花
@@ -57,6 +127,15 @@ public class WaterSprite : Boss
         jumpMoveCS.OnJumpMove();
     }
 
+    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    {
+        base.BeHit(attackInfo, attackFrom, damage);
+        if (hp <= nextAimHP)
+        {
+            ChangeStage(BossStage.polliwog);
+        }
+    }
+
     public override void RandomAttackType(AttackCategories cate)
     {
         AttackAssignment[] attacks = attackConfigurations[(int)cate].attacks;

+ 28 - 0
ActionTowerDefense/Assets/Scripts/PolliwogShot.cs

@@ -14,6 +14,9 @@ public class PolliwogShot : SpecialSkills
     private bool isAttack;
     private SpineEvent se;
 
+    [HideInInspector]
+    public List<Polliwog> pollis;
+
     public override void Attack()
     {
         se = owner.GetComponent<Enemy>().spineEvent;
@@ -32,6 +35,31 @@ public class PolliwogShot : SpecialSkills
         }
     }
 
+    public void Shoot(int numm, Vector3 poss)
+    {
+        pollis = new List<Polliwog>();
+        for (int i = 0; i < numm; i++)
+        {
+            if (PolliwogManager.GetInstance().IsFull()) break;
+            PoolManager.InstantiateAsync("Prefab/Enemy/Enemy_Polliwog", poss, new Quaternion(0, 0, 0, 0), null, obj =>
+            {
+                Polliwog pol = obj.GetComponent<Polliwog>();
+                pollis.Add(pol);
+            });
+        }
+    }
+
+    public void AllPoliDie()
+    {
+        foreach(Polliwog pol in pollis)
+        {
+            if (!pol.isDie)
+            {
+                pol.ChangeState(CharacterState.Die);
+            }
+        }
+    }
+
     private void Update()
     {
         if (isAttack)