/// <summary> /// 等级提升界面 /// </summary> /// <param name="context"></param> /// <param name="character"></param> public LevelupScreen(SimulatorContext context, PlayerCharacter character) : base(context) { _infoImg = Context.LibData.GetImage(2, 9)[0]; ICanvas canvas = Context.GraphicsFactory.NewCanvas(_infoImg);; ResLevelupChain levelupChain = character.LevelupChain; int curl = character.Level; Context.Util.DrawSmallNum(canvas, character.HP, 37, 9); character.HP = character.MaxHP; Context.Util.DrawSmallNum(canvas, character.MaxHP - (levelupChain.GetMaxHP(curl) - levelupChain.GetMaxHP(curl - 1)), 56, 9); Context.Util.DrawSmallNum(canvas, character.MaxHP, 86, 9); Context.Util.DrawSmallNum(canvas, character.MaxHP, 105, 9); Context.Util.DrawSmallNum(canvas, character.MP, 37, 21); character.MP = character.MaxMP; Context.Util.DrawSmallNum(canvas, character.MaxMP - (levelupChain.GetMaxMP(curl) - levelupChain.GetMaxMP(curl - 1)), 56, 21); Context.Util.DrawSmallNum(canvas, character.MaxMP, 86, 21); Context.Util.DrawSmallNum(canvas, character.MaxMP, 105, 21); Context.Util.DrawSmallNum(canvas, character.Attack - (levelupChain.GetAttack(curl) - levelupChain.GetAttack(curl - 1)), 47, 33); Context.Util.DrawSmallNum(canvas, character.Attack, 96, 33); Context.Util.DrawSmallNum(canvas, character.Defend - (levelupChain.GetDefend(curl) - levelupChain.GetDefend(curl - 1)), 47, 45); Context.Util.DrawSmallNum(canvas, character.Defend, 96, 45); Context.Util.DrawSmallNum(canvas, character.Speed - (levelupChain.GetSpeed(curl) - levelupChain.GetSpeed(curl - 1)), 47, 57); Context.Util.DrawSmallNum(canvas, character.Speed, 96, 57); Context.Util.DrawSmallNum(canvas, character.Lingli - (levelupChain.GetLingli(curl) - levelupChain.GetLingli(curl - 1)), 47, 69); Context.Util.DrawSmallNum(canvas, character.Lingli, 96, 69); Context.Util.DrawSmallNum(canvas, character.Luck - (levelupChain.GetLuck(curl) - levelupChain.GetLuck(curl - 1)), 47, 81); Context.Util.DrawSmallNum(canvas, character.Luck, 96, 81); }
/// <summary> /// 获取资源 /// </summary> /// <param name="resType">资源文件类型号1-12</param> /// <param name="type">资源类型</param> /// <param name="index">资源索引号</param> /// <returns>资源对象,不存在则返回</returns> public ResBase GetRes(int resType, int type, int index) { ResBase rtn = null; int offset = GetDataOffset(resType, type, index); //TODO 超过索引的资源直接不处理??? if (offset != -1 && offset < _data.Length) { switch (resType) { case RES_GUT: rtn = new ResGut(Context); break; case RES_MAP: rtn = new ResMap(Context); break; case RES_ARS: switch (type) { case 1: // 玩家角色 rtn = new PlayerCharacter(Context); break; case 2: // NPC角色 rtn = new NPC(Context); break; case 3: // 敌人角色 rtn = new Monster(Context); break; case 4: // 场景对象 rtn = new SceneObj(Context); break; default: rtn = null; break; } break; case RES_MRS: rtn = InternalGetMagic(type, index); break; case RES_SRS: rtn = new ResSrs(Context); break; case RES_GRS: rtn = InternalGetGoods(type, index); break; case RES_TIL: case RES_ACP: case RES_GDP: case RES_GGJ: case RES_PIC: rtn = new ResImage(Context); break; case RES_MLR: if (type == 1) { rtn = new ResMagicChain(Context); } else if (type == 2) { rtn = new ResLevelupChain(Context); } break; } rtn.SetData(_data, offset); } else { // 资源不存在 //Log.e("Context.LibData.GetRes", "resType:" + resType + " type:" + type + " index:" + index + " not found."); } return(rtn); }