using System;
namespace YLBattle
{
///
/// 敌方适配器
///
public class MonsterAdapter : IFighterAdapter
{
///
/// 英雄实例数据
///
private sm_hero mTemplete = null;
///
/// 英雄实例数据
///
private GameHeroVo mIns = null;
///
/// 是否可以修改玩家数据
///
private bool canModify = false;
///
/// 等级
///
private int mLevel = 0;
///
///
///
private int mSeat = 0;
///
///
///
private bool isBoss = false;
///
/// 构造(pve)
///
/// 模板
public MonsterAdapter(string _strIid, string lv, string _Boss, string _seat)
{
this.mTemplete = sm_hero.GetMoByID(_strIid);
this.canModify = false;
this.mLevel = System.Convert.ToInt32(lv);
this.isBoss = System.Convert.ToInt32(_Boss) == 0 ? false : true;
this.mSeat = System.Convert.ToInt32(_seat);
mIns = new GameHeroVo();
mIns.level = System.Convert.ToInt32(lv);
mIns.typeId = _strIid;
var vo = sm_heroextra_dengjie.QueryMeetsConditionStrengthInfoByLevel(mIns.level);
if (vo != null)
{
mIns.strengthLevel = vo.typeId;
}
}
///
/// Boss
///
///
public bool IsLeader()
{
return this.isBoss;
}
///
/// 关联对象实例
///
/// 对象实例
public object Inst()
{
return this.mTemplete;
}
///
/// 角色类型 0=小怪 1=英雄 (战斗中英雄使用公共技能槽)
///
///
public int RoleType()
{
return this.mTemplete.roletype;
}
///
///
///
///
public string FName()
{
return this.mTemplete.name;
}
///
/// 英雄实例ID, 敌方没有
///
///
public string IID()
{
return string.Empty;
}
///
/// 玩家ID (友情帮助时才有此数据)
///
///
public string PlayerUID()
{
return string.Empty;
}
///
///
///
///
public string TID()
{
return this.mTemplete.heroId.ToString();
}
///
/// 技能列表
///
///
//public int CriticalPowerRate()
//{
// return SkillProxy.Instance.GetSkillCondiValue(this.mTemplete.manuSkill2);
//}
///
///
///
///
public int Seat
{
set { this.mSeat = value; }
get
{
return this.mSeat;
}
}
///
/// 等级
///
///
public int Level()
{
return this.mLevel;
}
///
/// 等阶
///
///
public int StrengthLevel()
{
return this.mIns.strengthLevel;
}
///
///
///
///
public string NormalSound()
{
return this.mTemplete.normalSound;
}
///
///
///
///
public string SkillSound()
{
return this.mTemplete.skillSound;
}
///
///
///
///
public string BeattackSound()
{
return this.mTemplete.beattackSound;
}
///
///
///
///
public string DragonboneName()
{
return this.mTemplete.dragonBoneMod;
}
///
///
///
///
//public int Attack()
//{
// return this.mTemplete.wuligongji;
//}
///
///
///
///
public int Agile()
{
return (int)((1 / this.mTemplete.gongjisudu) * 1000.0f);
}
#region 战斗技能
///
/// 手动攻击技能
///
/// 技能模板id
public string NormalSkill()
{
return this.mTemplete.normalSkill;
}
///
/// 主动技能1
///
/// 技能模板id
public string ManuSkill1()
{
return this.mTemplete.manuSkill1;
}
///
/// 主动技能2
///
/// 技能模板id
public string ManuSkill2()
{
return this.mTemplete.manuSkill2;
}
///
/// 队长技能
///
/// 技能模板id
public string PassiveSkill()
{
return this.mTemplete.passiveSkill;
}
///
/// (敌方无)队长技能
///
/// 技能模板id
public string LeaderSkill()
{
return string.Empty;
}
///
/// 获取英雄技能列表
///
/// 技能列表
public string[] Skills()
{
return new string[] { this.mTemplete.normalSkill,
this.mTemplete.manuSkill1,
this.mTemplete.manuSkill2,
this.mTemplete.passiveSkill
};
}
///
/// 获取英雄技能列表
///
/// 技能列表
[Obsolete("过时,2020.4.21")]
public int SkillLevel(string tid)
{
string parm = string.Empty;
if (tid == this.mTemplete.normalSkill)
{
parm = "normalSkill";
}
if (tid == this.mTemplete.manuSkill1)
{
parm = "manuSkill1";
}
if (tid == this.mTemplete.manuSkill2)
{
parm = "manuSkill2";
}
if (tid == this.mTemplete.passiveSkill)
{
parm = "passiveSkill";
}
return this.mIns.GetSkillLevel(parm);
}
///
/// 获取技能冷冻回合数
///
///
//public int GetSkillBeLockedRound(string skillId)
//{
// return SkillProxy.Instance.GetSkillCondiValue(skillId);
//}
#endregion
///
///
///
///
///
public double GetProperty(EBattleProperty ep)
{
///属性值=初始值+成长*(等级-1)
double pvalue = 0;
switch (ep)
{
case EBattleProperty.HP:
pvalue = this.mIns.getHpForBattle();
break;
case EBattleProperty.HPMAX:
pvalue = this.mIns.getHpForBattle();
break;
case EBattleProperty.ATTACK:
pvalue = this.mIns.getWuLiGongJiForBattle();
break;
case EBattleProperty.ATTACKSPEED:
pvalue = this.mIns.getGongJiSuDuForBattle();
break;
case EBattleProperty.CRITICALPROB:
//pvalue = this.mIns.getCriticalForBattle(); // 2020.6.3 根据策划指导修正暴击率
pvalue = this.mIns.getCriticalRatioInBattle();
break;
case EBattleProperty.DEFENSE:
pvalue = this.mIns.getFangYuHuJiaForBattle();
break;
case EBattleProperty.MAGICFORCE:
pvalue = this.mIns.getMoFaKangXingForBattle();
break;
case EBattleProperty.MAGICSTRENGTH:
pvalue = this.mIns.getFaShuQiangDuForBattle();
break;
case EBattleProperty.LEVEL:
pvalue = this.mLevel;
break;
case EBattleProperty.NMAXPOWER:
pvalue = this.mTemplete.npower;
break;
case EBattleProperty.NPOWER:
pvalue = 0;
break;
case EBattleProperty.HEIGHT:
pvalue = this.mTemplete.height;
break;
default:
pvalue = 0;
break;
}
return pvalue;
}
///
///
///
///
///
public void ModifyProperty(EBattleProperty ep, float val)
{
if (this.canModify == false)
{
return;
}
}
}
}