346 lines
8.3 KiB
C#
346 lines
8.3 KiB
C#
using System;
|
||
using UnityEngine;
|
||
|
||
namespace Game
|
||
{
|
||
//角色经验
|
||
public class S_ROLE_EXP
|
||
{
|
||
public int level;//等级
|
||
public int exp;//经验
|
||
|
||
public void Init()
|
||
{
|
||
level = 0;
|
||
exp = 0;
|
||
}
|
||
}
|
||
|
||
//角色经济
|
||
public class S_ROLE_ECON
|
||
{
|
||
public long gold;//金币
|
||
public long vcoin;//元宝
|
||
public long silverCoin;//银币
|
||
public void Init()
|
||
{
|
||
gold = 0;
|
||
vcoin = 0;
|
||
silverCoin = 0;
|
||
}
|
||
}
|
||
|
||
//角色生命信息
|
||
public class S_ROLE_LIFE
|
||
{
|
||
public int curHP;
|
||
public int curMP;
|
||
public int maxHP;
|
||
public int maxMP;
|
||
public void Init()
|
||
{
|
||
curHP = 0;
|
||
curMP = 0;
|
||
maxHP = 0;
|
||
maxMP = 0;
|
||
}
|
||
}
|
||
|
||
//角色状态信息
|
||
public class S_ROLE_STATUS
|
||
{
|
||
public int state;//状态
|
||
public int face;//朝向
|
||
public int mapid;//地图ID
|
||
|
||
public Vector3 rot;//旋转
|
||
public Vector3 pos;
|
||
public Vector3 targetpos;//目标位置
|
||
public void Init()
|
||
{
|
||
state = 0;
|
||
face = 0;
|
||
mapid = 0;
|
||
pos.x = 0;
|
||
pos.y = 0;
|
||
pos.z = 0;
|
||
targetpos.x = 0;
|
||
targetpos.y = 0;
|
||
targetpos.z = 0;
|
||
|
||
rot.x = 0; rot.y = 0; rot.z = 0;
|
||
}
|
||
}
|
||
|
||
//角色先天属性 出身即有的
|
||
public class S_ROLE_INNATE
|
||
{
|
||
public Int64 roleid;//角色id
|
||
public int job;//职业
|
||
public int sex;//性别
|
||
public string nick;//昵称
|
||
public void Init()
|
||
{
|
||
roleid = 0;
|
||
job = 0;
|
||
sex = 0;
|
||
nick = "";
|
||
}
|
||
}
|
||
|
||
|
||
//1级战斗属性
|
||
public class S_ROLE_BATTLEATTR_1ST
|
||
{
|
||
public uint Strength;//力量
|
||
public uint Agility;//敏捷
|
||
public uint Intellect;//智力
|
||
public uint Constitution;//体质
|
||
|
||
public void Init()
|
||
{
|
||
Strength = 0;
|
||
Agility = 0;
|
||
Intellect = 0;
|
||
Constitution = 0;
|
||
}
|
||
}
|
||
|
||
//战斗属性
|
||
public class S_ROLE_BATTLEATTR
|
||
{
|
||
public int pAtkMin; //最小物理攻击
|
||
public int pAtkMax; //最大物理攻击
|
||
|
||
public int PDef; //物理防御
|
||
public int Hit; //命中值
|
||
public int Dodge; //闪避值
|
||
public int CritRate; //暴击率(百分比)
|
||
public int Speed; //移动速度
|
||
public int StiffnessRes; //僵直耐性
|
||
public int FireRes; //火焰抗性
|
||
public int IceRes; //冰霜抗性
|
||
public int FlashRes; //闪电抗性
|
||
public int PoisonRes; //毒素抗性
|
||
public int FirePAtk; //火系物攻
|
||
public int IcePAtk; //冰系物攻
|
||
public int FlashPAtk; //电系物攻
|
||
public int PoisonPAtk; //毒系物攻
|
||
public int FireMAtkMin; //最小火系法攻
|
||
public int FireMAtkMax; //最大火系法攻
|
||
public int IceMAtkMin; //最小冰系法攻
|
||
public int IceMAtkMax; //最大冰系法攻
|
||
public int FlashMAtkMin; //最小电系法攻
|
||
public int FlashMAtkMax; //最大电系法攻
|
||
public int PoisonMAtkMin; //最小毒系法攻
|
||
public int PoisonMAtkMax; //最大毒系法攻
|
||
|
||
|
||
public void Init()
|
||
{
|
||
pAtkMin = 0;
|
||
pAtkMax = 0;
|
||
PDef = 0;
|
||
Hit = 0;
|
||
Dodge = 0;
|
||
CritRate = 0;
|
||
Speed = 0;
|
||
StiffnessRes = 0;
|
||
FireRes = 0;
|
||
IceRes = 0;
|
||
FlashRes = 0;
|
||
PoisonRes = 0;
|
||
FirePAtk = 0;
|
||
IcePAtk = 0;
|
||
FlashPAtk = 0;
|
||
PoisonPAtk = 0;
|
||
FireMAtkMin = 0;
|
||
FireMAtkMax = 0;
|
||
IceMAtkMin = 0;
|
||
IceMAtkMax = 0;
|
||
FlashMAtkMin = 0;
|
||
FlashMAtkMax = 0;
|
||
PoisonMAtkMin = 0;
|
||
PoisonMAtkMax = 0;
|
||
}
|
||
}
|
||
|
||
//社交类属性
|
||
public class S_ROLE_SOCIALATTR
|
||
{
|
||
public uint headId;
|
||
public uint headFrameId;
|
||
public uint title;
|
||
public int reputation;//声望
|
||
public int activation;//活跃度
|
||
public uint crimeValue;//罪恶值
|
||
public int vitality;// 活力,TODO暂时放在社交属性里,待完善
|
||
public void Init()
|
||
{
|
||
headId = 0;
|
||
headFrameId = 0;
|
||
title = 0;
|
||
reputation = 0;
|
||
activation = 0;
|
||
crimeValue = 0;
|
||
vitality = 0;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
public class S_ROLE_TEMP_Skill
|
||
{
|
||
public int scriptindex;//技能脚本
|
||
public float time_temp;//技能冷却时间
|
||
//public SkillConfig script_skill;//技能脚本
|
||
//public Skill_LevelConfig script_level;//技能等级脚本
|
||
public void Init()
|
||
{
|
||
scriptindex = 0;
|
||
time_temp = 0;
|
||
//script_skill = null;
|
||
//script_level = null;
|
||
}
|
||
};
|
||
|
||
//攻击锁定
|
||
public class S_LOCK_DATA
|
||
{
|
||
public byte lock_state;
|
||
public byte lock_skillindex;
|
||
public int lock_skillid;
|
||
public byte lock_type;
|
||
public int lock_index;
|
||
public Vector3 lock_targetpos;
|
||
public int lock_distance;
|
||
|
||
public void Init()
|
||
{
|
||
lock_state = 0;
|
||
lock_skillid = -1;
|
||
lock_skillindex = 0;
|
||
lock_type = 0;
|
||
lock_index = -1;
|
||
lock_targetpos.x = 0;
|
||
lock_targetpos.y = 0;
|
||
lock_targetpos.z = 0;
|
||
lock_distance = 0;
|
||
}
|
||
}
|
||
|
||
//玩家临时数据
|
||
public class S_ROLE_TEMP
|
||
{
|
||
public float heartTime;
|
||
public float skill_PublicTime;
|
||
public S_LOCK_DATA lockData;//攻击锁定
|
||
public S_ROLE_TEMP_Skill[] skill;
|
||
|
||
public S_ROLE_TEMP()
|
||
{
|
||
lockData = new S_LOCK_DATA();
|
||
skill = new S_ROLE_TEMP_Skill[ConstClass.MAXSKILLCOUNT];
|
||
for (int i = 0; i < ConstClass.MAXSKILLCOUNT; i++)
|
||
skill[i] = new S_ROLE_TEMP_Skill();
|
||
}
|
||
public void Init()
|
||
{
|
||
heartTime = 0;
|
||
skill_PublicTime = 0;
|
||
}
|
||
public void UpdateHeartTime()
|
||
{
|
||
heartTime = Time.time;
|
||
}
|
||
}
|
||
|
||
|
||
public class S_ROLE_SKILLHUB
|
||
{
|
||
public void Init()
|
||
{
|
||
attributePoint = 0;
|
||
skillPoint = 0;
|
||
talentPoint = 0;
|
||
}
|
||
|
||
public uint attributePoint; //剩余属性点
|
||
public uint skillPoint; //剩余技能点
|
||
public uint talentPoint; //当前天赋点
|
||
}
|
||
|
||
public class S_ROLE_SKILL
|
||
{
|
||
public int id;
|
||
public int level;
|
||
public int index;
|
||
public int shortcut;
|
||
|
||
public void Init()
|
||
{
|
||
id = 0;
|
||
level = 0;
|
||
index = 0;
|
||
shortcut = 0;
|
||
}
|
||
}
|
||
|
||
//移动控制数据
|
||
public class S_ROLE_MOVE
|
||
{
|
||
public int state;//状态
|
||
public int oldstate;//历史状态
|
||
public float speed;//速度
|
||
public float face;//方向 = y轴
|
||
public Vector3 pos;//坐标
|
||
public float syncTime;//同步时间
|
||
|
||
public void Init()
|
||
{
|
||
state = 0;
|
||
oldstate = 0;
|
||
speed = 0;
|
||
face = 0;
|
||
syncTime = 0;
|
||
pos.x = 0; pos.y = 0; pos.z = 0;
|
||
}
|
||
}
|
||
|
||
//主控玩家角色数据
|
||
public class S_ROLE_SELF : S_ROLE_BASE
|
||
{
|
||
public S_ROLE_ECON econ;//经济
|
||
public S_ROLE_SKILL[] skill;
|
||
public S_ROLE_SKILLHUB skillhub;//技能面板用属性
|
||
public MainPlayerDataSet myDataSet => (MainPlayerDataSet)this.dataSet;
|
||
|
||
//玩家显示
|
||
public MyView myView;
|
||
|
||
public S_ROLE_MOVE move;
|
||
public S_ROLE_SELF()
|
||
{
|
||
move = new S_ROLE_MOVE();
|
||
econ = new S_ROLE_ECON();
|
||
skill = new S_ROLE_SKILL[ConstClass.MAXSKILLCOUNT];
|
||
skillhub = new S_ROLE_SKILLHUB();
|
||
for (int i = 0; i < ConstClass.MAXSKILLCOUNT; i++)
|
||
{
|
||
skill[i] = new S_ROLE_SKILL();
|
||
}
|
||
}
|
||
override public void Init()
|
||
{
|
||
base.Init();
|
||
exp.Init();
|
||
move.Init();
|
||
econ.Init();
|
||
skillhub.Init();
|
||
for (int i = 0; i < ConstClass.MAXSKILLCOUNT; i++) skill[i].Init();
|
||
}
|
||
}
|
||
}
|
||
|