Example #1
0
 public FightEffectPiece(PieceType type, int hitcount, string prop, int add, BeHurtStateTable behurt, Vector3 firepos, bool hold, bool hurtfiend)
 {
     //Debug.LogError("prop = " + prop);
     this.type        = type;
     this.hitcount    = hitcount;
     this.prop        = prop;
     this.add         = add;
     this.beHurtState = behurt;
     this.firepos     = firepos;
     this.hold        = hold;
     this.hurtfiend   = hurtfiend;
 }
Example #2
0
        public bool AddHit(int id, int hash, int hitcount, string prop, int add, BeHurtStateTable attackeffect, Vector3 firepos, bool hold, bool hurtfriend)
        {
            //int hashi = FightEffectPiece.CalcHash(PieceType.Hit, prop, add);
            var eff = (id == AID) ? AEffect : BEffect;

            if (eff.ContainsKey(hash)) //效果不能重复添加
            {
                return(false);
            }
            if (bUsed)
            {
                //if (!eff.ContainsKey(hashi))//用过了,新的效果,clear重来。
                Clear();
            }

            eff[hash] = new FightEffectPiece(PieceType.Hit, hitcount, prop, add, attackeffect, firepos, hold, hurtfriend);
            //Debug.Log("AddHitEffect:" + hitcount + "," + prop + "," + add + "," + enemytostate);
            bInited = true;

            //use 才计算happy
            //happy = id;

            return(false);
        }
        public bool FE_AddHit(int hitenemycount, int hash, int hitcount, string prop, int add, BeHurtStateTable attackeffect, bool hold, bool hurtfriend)
        {
            if (ap.attackmap.Count == 0)
            {
                return(false);
            }

            //Debug.Log("FE_AddHit:" + hitcount + "," + prop + "," + add + "," + enemytostate);
            //得到冲突
            foreach (var dest in ap.attackmap)
            {
                if (hitenemycount == 0)
                {
                    break;
                }
                hitenemycount--;
                if (battleField.GetCharactorController(dest.Key).Death)
                {
                    continue;
                }
                var fe = battleField.GetFightEvent(this.id, dest.Key);
                if (fe.AddHit(this.id, hash, hitcount, prop, add, attackeffect, dest.Value, hold, hurtfriend))
                {
                    return(true);
                }
            }
            return(false);
            //throw new NotImplementedException();
        }