完成 剑类 初步设计
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import { HeroList } from "./heroSet"
|
||||
import { HeroSkillList, SkillSet } from "./SkillSet"
|
||||
import { accessorys, armors, equip_list, EquipType, weapons } from "./Equips"
|
||||
import { equip_list, weapons, armors, accessorys } from "./Equips"
|
||||
|
||||
//1:伙伴 2:技能 3:装备的出现概率配置
|
||||
export const CardProbability={
|
||||
@@ -100,7 +100,7 @@ export function getRandomCardUUIDByType(type: number): number {
|
||||
export function getRandomCardsByType(
|
||||
type: number,
|
||||
count: number,
|
||||
equipSubType?: number // 新增参数
|
||||
equipSubType?: number // 新增参数:装备子类型 1:武器 2:防具 3:饰品 0或undefined:全部
|
||||
): { type: number; uuid: number }[] {
|
||||
let cardList: number[] = [];
|
||||
switch (type) {
|
||||
@@ -111,16 +111,24 @@ export function getRandomCardsByType(
|
||||
cardList = HeroSkillList; // 直接使用HeroSkillList数组
|
||||
break;
|
||||
case cardType.EQUIP:
|
||||
switch(equipSubType){
|
||||
case EquipType.WEAPON:
|
||||
cardList = weapons ;
|
||||
break;
|
||||
case EquipType.ARMOR:
|
||||
cardList = armors;
|
||||
break;
|
||||
case EquipType.ACCESSORY:
|
||||
cardList = accessorys;
|
||||
break;
|
||||
// 根据装备子类型筛选
|
||||
if (equipSubType && equipSubType > 0) {
|
||||
switch (equipSubType) {
|
||||
case 1: // 武器
|
||||
cardList = weapons;
|
||||
break;
|
||||
case 2: // 防具
|
||||
cardList = armors;
|
||||
break;
|
||||
case 3: // 饰品
|
||||
cardList = accessorys;
|
||||
break;
|
||||
default:
|
||||
cardList = equip_list;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
cardList = equip_list;
|
||||
}
|
||||
break;
|
||||
case cardType.SPECIAL:
|
||||
|
||||
@@ -36,7 +36,7 @@ export enum EquipSpecialAttr {
|
||||
ATK_ADD_MASTER_ATK=8, //主将攻击力增加
|
||||
ATK_ADD_MASTER_HP=9, //主将生命值增加
|
||||
DOUBLE_DEAD=10, //双倍死亡触发
|
||||
DOUBLE_ATKED=11, //双倍受击触发\
|
||||
DOUBLE_ATKED=11, //双倍受击触发
|
||||
}
|
||||
export enum Quality {
|
||||
WHITE = 1,
|
||||
@@ -46,10 +46,26 @@ export enum Quality {
|
||||
ORANGE = 5,
|
||||
RED = 6,
|
||||
}
|
||||
export const weapons=[2001,2002,2003]
|
||||
export const armors=[2001,2002,2003]
|
||||
export const accessorys=[2001,2002,2003]
|
||||
export const equip_list=[2001,2002,2003,]
|
||||
|
||||
// 剑类武器UUID列表 - 根据wp.md配置
|
||||
export const swordWeapons = [
|
||||
// 等级1
|
||||
2101, 2102, 2103, // 绿、蓝、紫
|
||||
// 等级2
|
||||
2201, 2202, 2203, // 绿、蓝、紫
|
||||
// 等级3
|
||||
2301, 2302, 2303, // 绿、蓝、紫
|
||||
// 等级4
|
||||
2401, 2402, 2403, // 绿、蓝、紫
|
||||
// 等级5
|
||||
2501, 2502, 2503, // 绿、蓝、紫
|
||||
];
|
||||
|
||||
export const weapons = swordWeapons;
|
||||
export const armors = [2001, 2002, 2003];
|
||||
export const accessorys = [2001, 2002, 2003];
|
||||
export const equip_list = [...swordWeapons, ...armors, ...accessorys];
|
||||
|
||||
// 装备属性加成接口
|
||||
export interface EquipAttribute {
|
||||
type: BuffAttr; // 属性类型
|
||||
@@ -72,7 +88,224 @@ export interface EquipData {
|
||||
special_attr: EquipSpecialAttrData[]; // 特殊属性数组
|
||||
buff: EquipAttribute[]; // 属性加成列表
|
||||
}
|
||||
|
||||
export const EquipInfo: { [key: number]: EquipData } = {
|
||||
// 等级1 剑类武器
|
||||
2101: {
|
||||
uuid: 2101,
|
||||
name: "穿刺短剑(Lv1)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.GREEN,
|
||||
info: "攻击力增加50%,穿透1个目标",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 50, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO }, // 穿刺1个目标
|
||||
],
|
||||
},
|
||||
2102: {
|
||||
uuid: 2102,
|
||||
name: "寒锋长剑(Lv1)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.BLUE,
|
||||
info: "攻击力增加70%,穿透2个目标,10%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 70, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO }, // 穿刺2个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 10, target: EquipAttrTarget.HERO }, // 10%冰冻比率
|
||||
],
|
||||
},
|
||||
2103: {
|
||||
uuid: 2103,
|
||||
name: "虚空穿心剑(Lv1)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.PURPLE,
|
||||
info: "攻击力增加95%,穿透3个目标,20%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 95, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 3, target: EquipAttrTarget.HERO }, // 穿刺3个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 20, target: EquipAttrTarget.HERO }, // 20%冰冻比率
|
||||
],
|
||||
},
|
||||
|
||||
// 等级2 剑类武器
|
||||
2201: {
|
||||
uuid: 2201,
|
||||
name: "穿刺短剑(Lv2)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.GREEN,
|
||||
info: "攻击力增加80%,穿透1个目标",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 80, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO }, // 穿刺1个目标
|
||||
],
|
||||
},
|
||||
2202: {
|
||||
uuid: 2202,
|
||||
name: "寒锋长剑(Lv2)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.BLUE,
|
||||
info: "攻击力增加110%,穿透2个目标,15%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 110, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO }, // 穿刺2个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 15, target: EquipAttrTarget.HERO }, // 15%冰冻比率
|
||||
],
|
||||
},
|
||||
2203: {
|
||||
uuid: 2203,
|
||||
name: "虚空穿心剑(Lv2)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.PURPLE,
|
||||
info: "攻击力增加140%,穿透3个目标,25%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 140, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 3, target: EquipAttrTarget.HERO }, // 穿刺3个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 25, target: EquipAttrTarget.HERO }, // 25%冰冻比率
|
||||
],
|
||||
},
|
||||
|
||||
// 等级3 剑类武器
|
||||
2301: {
|
||||
uuid: 2301,
|
||||
name: "穿刺短剑(Lv3)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.GREEN,
|
||||
info: "攻击力增加110%,穿透1个目标",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 110, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO }, // 穿刺1个目标
|
||||
],
|
||||
},
|
||||
2302: {
|
||||
uuid: 2302,
|
||||
name: "寒锋长剑(Lv3)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.BLUE,
|
||||
info: "攻击力增加150%,穿透2个目标,20%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 150, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO }, // 穿刺2个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 20, target: EquipAttrTarget.HERO }, // 20%冰冻比率
|
||||
],
|
||||
},
|
||||
2303: {
|
||||
uuid: 2303,
|
||||
name: "虚空穿心剑(Lv3)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.PURPLE,
|
||||
info: "攻击力增加185%,穿透3个目标,30%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 185, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 3, target: EquipAttrTarget.HERO }, // 穿刺3个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 30, target: EquipAttrTarget.HERO }, // 30%冰冻比率
|
||||
],
|
||||
},
|
||||
|
||||
// 等级4 剑类武器
|
||||
2401: {
|
||||
uuid: 2401,
|
||||
name: "穿刺短剑(Lv4)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.GREEN,
|
||||
info: "攻击力增加140%,穿透1个目标",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 140, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO }, // 穿刺1个目标
|
||||
],
|
||||
},
|
||||
2402: {
|
||||
uuid: 2402,
|
||||
name: "寒锋长剑(Lv4)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.BLUE,
|
||||
info: "攻击力增加190%,穿透2个目标,25%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 190, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO }, // 穿刺2个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 25, target: EquipAttrTarget.HERO }, // 25%冰冻比率
|
||||
],
|
||||
},
|
||||
2403: {
|
||||
uuid: 2403,
|
||||
name: "虚空穿心剑(Lv4)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.PURPLE,
|
||||
info: "攻击力增加240%,穿透3个目标,35%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 240, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 3, target: EquipAttrTarget.HERO }, // 穿刺3个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 35, target: EquipAttrTarget.HERO }, // 35%冰冻比率
|
||||
],
|
||||
},
|
||||
|
||||
// 等级5 剑类武器
|
||||
2501: {
|
||||
uuid: 2501,
|
||||
name: "穿刺短剑(Lv5)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.GREEN,
|
||||
info: "攻击力增加170%,穿透1个目标",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 170, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO }, // 穿刺1个目标
|
||||
],
|
||||
},
|
||||
2502: {
|
||||
uuid: 2502,
|
||||
name: "寒锋长剑(Lv5)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.BLUE,
|
||||
info: "攻击力增加230%,穿透2个目标,30%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 230, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO }, // 穿刺2个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 30, target: EquipAttrTarget.HERO }, // 30%冰冻比率
|
||||
],
|
||||
},
|
||||
2503: {
|
||||
uuid: 2503,
|
||||
name: "虚空穿心剑(Lv5)",
|
||||
type: EquipType.WEAPON,
|
||||
quality: Quality.PURPLE,
|
||||
info: "攻击力增加290%,穿透3个目标,40%冰冻比率",
|
||||
special_attr: [],
|
||||
buff: [
|
||||
{ type: BuffAttr.ATK, value: 290, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.ATK_CD, value: -20, target: EquipAttrTarget.HERO }, // CD修正-20%
|
||||
{ type: BuffAttr.PUNCTURE, value: 3, target: EquipAttrTarget.HERO }, // 穿刺3个目标
|
||||
{ type: BuffAttr.FROST_RATIO, value: 40, target: EquipAttrTarget.HERO }, // 40%冰冻比率
|
||||
],
|
||||
},
|
||||
|
||||
// 保留原有的装备配置
|
||||
2001: {uuid: 2001, name: "新手剑", type: EquipType.WEAPON,quality: Quality.WHITE,info:"攻击力增加80%",
|
||||
special_attr: [
|
||||
{special_attr:EquipSpecialAttr.ATK_ADD_FRIEND_ATK,special_attr_value:3},
|
||||
@@ -88,7 +321,6 @@ export const EquipInfo: { [key: number]: EquipData } = {
|
||||
{ type: BuffAttr.ATK, value: 80, target: EquipAttrTarget.HERO },
|
||||
{ type: BuffAttr.WFUNY, value: 30, target: EquipAttrTarget.HERO },
|
||||
],
|
||||
|
||||
},
|
||||
2002: {uuid: 2002,name: "新手剑2",type: EquipType.WEAPON,quality: Quality.WHITE,info:"攻击速度增加30%",
|
||||
special_attr:[
|
||||
@@ -122,6 +354,5 @@ export const EquipInfo: { [key: number]: EquipData } = {
|
||||
{ type: BuffAttr.HP, value: 30, target: EquipAttrTarget.HERO },
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,9 @@ export enum BuffAttr {
|
||||
DEBUFF_VALUE = 15, //debuff效果
|
||||
DEBUFF_UP = 16, //debuff概率提升
|
||||
DEBUFF_DOWN = 17, //被debuff概率降低
|
||||
PUNCTURE = 18, //穿刺敌人伤害后方敌人
|
||||
PUNCTURE_DMG = 19, //穿刺敌人伤害后方敌人伤害加成
|
||||
FROST_RATIO = 20, //冰冻比率
|
||||
}
|
||||
|
||||
export const geDebuffNum=()=>{
|
||||
@@ -132,6 +135,9 @@ export const getBuffNum=()=>{
|
||||
DEBUFF_VALUE:0, //debuff效果
|
||||
DEBUFF_UP:0, //debuff概率提升
|
||||
DEBUFF_DOWN:0, //被debuff概率降低
|
||||
PUNCTURE:0, //穿刺敌人伤害后方敌人
|
||||
PUNCTURE_DMG:0, //穿刺敌人伤害后方敌人伤害加成
|
||||
FROST_RATIO:0, //冰冻比率
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,8 @@ export class HeroViewComp extends CCComp {
|
||||
dis: number = 80;
|
||||
at: number = 0; /** 冷却时间 */
|
||||
atk_skill:number=0;
|
||||
|
||||
puncture:number=0; //穿刺敌人伤害后方敌人个数
|
||||
puncture_damage:number=0; //后伤害加成
|
||||
def: number = 0; //防御
|
||||
vun: number = 0; //易伤
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { CardComp } from "./CardComp";
|
||||
import { cardType, getRandomCardsByType } from "../common/config/CardSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
import { EquipType } from "../common/config/Equips";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -75,13 +76,13 @@ export class CardsCompComp extends CCComp {
|
||||
let list=[]
|
||||
switch(data.slot){
|
||||
case "weapon":
|
||||
list=getRandomCardsByType(cardType.EQUIP,3)
|
||||
list=getRandomCardsByType(cardType.EQUIP,3,EquipType.WEAPON)
|
||||
break
|
||||
case "armor":
|
||||
list=getRandomCardsByType(cardType.EQUIP,3)
|
||||
list=getRandomCardsByType(cardType.EQUIP,3,EquipType.ARMOR)
|
||||
break
|
||||
case "accessory":
|
||||
list=getRandomCardsByType(cardType.EQUIP,3)
|
||||
list=getRandomCardsByType(cardType.EQUIP,3,EquipType.ACCESSORY)
|
||||
break
|
||||
}
|
||||
console.log("[CardsComp]:装备选择卡牌列表",list)
|
||||
|
||||
@@ -83,7 +83,8 @@ export class Skill extends ecs.Entity {
|
||||
SComp.ap = ap_data.ap
|
||||
SComp.caster_crit = ap_data.crit
|
||||
SComp.caster_crit_d = ap_data.crit_d
|
||||
|
||||
SComp.puncture = ap_data.puncture
|
||||
SComp.puncture_damage = ap_data.puncture_damage
|
||||
// 设置技能组件属性
|
||||
Object.assign(SComp, {
|
||||
s_uuid: uuid,
|
||||
@@ -108,6 +109,8 @@ export class Skill extends ecs.Entity {
|
||||
let crit_d=0
|
||||
let buff_ap=1
|
||||
let buff=null
|
||||
let puncture=0
|
||||
let puncture_damage=0
|
||||
if(view.is_master) buff=FIGHTCON.hero_buff
|
||||
if(view.is_friend) buff=FIGHTCON.friend_buff
|
||||
if(view.is_boss) buff=FIGHTCON.enemy_buff
|
||||
@@ -138,10 +141,11 @@ export class Skill extends ecs.Entity {
|
||||
}
|
||||
|
||||
let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成
|
||||
|
||||
puncture =buff.PUNCTURE+view.puncture
|
||||
puncture_damage=buff.PUNCTURE_DMG+view.puncture_damage
|
||||
ap=view.ap*buff_ap*BUFF_AP*SkillSet[uuid].ap/100
|
||||
crit=view.crit+buff.CRITICAL
|
||||
crit_d=view.crit_d+buff.CRITICAL_DMG
|
||||
return {ap,crit,crit_d}
|
||||
return {ap,crit,crit_d,puncture,puncture_damage}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ export class SkillCom extends CCComp {
|
||||
t_end_x:number=0;
|
||||
caster_crit:number=0;
|
||||
caster_crit_d:number=0;
|
||||
puncture:number=0;
|
||||
puncture_damage:number=0;
|
||||
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
|
||||
|
||||
protected onLoad(): void {
|
||||
|
||||
Reference in New Issue
Block a user