ItemData 创建数据模型
效果图
模型说明
ID:不是自增列,约束命名规则方便排序及长着,ID命名规则为,ItemType + HeroType + Index,如300001,代表武器 + 所有角色都能使用 + 001号
Price:购买价格,售价就是购买价格乘以固定比例
IconPath: Resouces图片文件目录相对路径
ItemType: 类型,对应枚举变量
0: Other 10:Potion 20:Stuff 30:Weapon 31:Armor 32:Ring
33:Necklace
跳号进行编写枚举是为了方便扩展
HeroType: 哪些英雄可以使用
CanLvUp: 是否可以升级
Lv:基础等级
Max:最大等级
Hp:基础属性,该Item给持有角色带来的额外附加属性
HpGrowth:每升一级增加属性
StackCount:在背包里最大堆叠数量
数据库
CREATE TABLE `iteminfo` (
`Id` int(11) NOT NULL DEFAULT '0' COMMENT 'ItemType + HeroTyp + Index',
`name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`itemType` int(11) DEFAULT '0' COMMENT '0: Other 10:Potion 20:Stuff 30:Weapon 31:Armor 32:Ring 33:Necklace',
`price` int(11) DEFAULT '0',
`iconPath` varchar(255) DEFAULT NULL,
`heroType` int(11) DEFAULT '0' COMMENT '0: All, 1: hero1, 2: hero2',
`lv` int(11) DEFAULT '1',
`maxLv` int(11) DEFAULT '1',
`hp` int(11) DEFAULT '0',
`mp` int(11) DEFAULT '0',
`atk` int(11) DEFAULT '0',
`def` int(11) DEFAULT '0',
`spd` int(11) DEFAULT '0',
`hit` int(11) DEFAULT '0',
`criticalRate` double(5,2) DEFAULT '0.00',
`atkSpd` double(5,2) DEFAULT '0.00',
`atkRange` double(5,2) DEFAULT '0.00',
`MoveSpd` double(5,2) DEFAULT '0.00',
`hp_growth` int(11) DEFAULT '0',
`mp_growth` int(11) DEFAULT '0',
`atk_growth` int(11) DEFAULT '0',
`def_growth` int(11) DEFAULT '0',
`spd_growth` int(11) DEFAULT '0',
`hit_g