Compare commits
3 Commits
100a520df1
...
b9f7a66fae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9f7a66fae | ||
|
|
0676412a5a | ||
|
|
8ab0cc3971 |
@@ -26,8 +26,6 @@ export enum Attrs {
|
||||
|
||||
// ==================== 特殊效果属性 ====================
|
||||
freeze_chance = "freeze_chance", // 冰冻概率
|
||||
revive_count = "revive_count", // 复活次数
|
||||
revive_time = "revive_time", // 复活时间
|
||||
invincible_time = "invincible_time",// 无敌时间
|
||||
puncture = "puncture", // 穿刺次数
|
||||
wfuny = "wfuny", // 风怒
|
||||
|
||||
@@ -296,6 +296,11 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"随机3个友方+2攻击,+10最大生命值",
|
||||
},
|
||||
6501:{
|
||||
uuid:6501,name:"复活",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"ap_up",endAnm:"",act:"atk",
|
||||
DTType:DTType.single,kind:SkillKind.Support,ap:50,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
|
||||
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"立即复活,获得50%生命",
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
11
assets/script/game/common/config/hero-roster.md.meta
Normal file
11
assets/script/game/common/config/hero-roster.md.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "1.0.1",
|
||||
"importer": "text",
|
||||
"imported": true,
|
||||
"uuid": "c86bee35-69d7-43a9-ab1a-967c1e4f08a8",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -70,6 +70,7 @@ export interface heroInfo {
|
||||
field?:number[]; // 驻场技能uuid列表,英雄在场时对全局生效
|
||||
atking?:{s_uuid:number, t_num:number}[]; // 普通攻击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的普攻次数
|
||||
atked?:{s_uuid:number, t_num:number}[]; // 受击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的受击次数
|
||||
revive?:{s_uuid:number,r_num:number,upr:number}[]
|
||||
// dis: number; // 攻击距离(像素)
|
||||
speed: number; // 移动速度(像素/秒)
|
||||
skills: Record<number, HSkillInfo> ; // 携带技能ID列表
|
||||
|
||||
@@ -116,6 +116,7 @@ export class Hero extends ecs.Entity {
|
||||
model.fend = hero.fend;
|
||||
model.atking = hero.atking;
|
||||
model.atked = hero.atked;
|
||||
model.revive = hero.revive;
|
||||
|
||||
// 基础属性按等级倍率初始化
|
||||
// 使用指数增长公式,等级2时为原来的3倍,等级3时为原来的9倍 (若需线性增长可改为 hero.ap * (1 + (model.lv - 1) * (FightSet.H_HERO_POW - 1)))
|
||||
|
||||
@@ -188,16 +188,25 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
||||
// 检查死亡
|
||||
if (TAttrsComp.hp <= 0) {
|
||||
// 复活机制:如果玩家属性内的复活属性值>=1 则执行复活,原地50%血量复活
|
||||
if (TAttrsComp.revive_count >= 1) {
|
||||
TAttrsComp.revive_count--;
|
||||
let canRevive = false;
|
||||
let maxReviveCount = 0;
|
||||
if (TAttrsComp.revive && TAttrsComp.revive.length > 0) {
|
||||
const reviveConf = TAttrsComp.revive[0];
|
||||
maxReviveCount = reviveConf.r_num + Math.floor((TAttrsComp.lv - 1) * reviveConf.upr);
|
||||
if (TAttrsComp.revived_count < maxReviveCount) {
|
||||
canRevive = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (canRevive) {
|
||||
TAttrsComp.revived_count++;
|
||||
TAttrsComp.is_reviving = true; // 标记为正在复活
|
||||
// 触发死亡动画(假死)
|
||||
if (targetView) {
|
||||
targetView.do_dead();
|
||||
// 延迟1秒复活
|
||||
targetView.scheduleRevive(1.0);
|
||||
|
||||
}
|
||||
mLogger.log(this.debugMode, 'HeroAtkSystem', ` Hero waiting to revive! Lives left: ${TAttrsComp.revive_count}`);
|
||||
mLogger.log(this.debugMode, 'HeroAtkSystem', ` Hero waiting to revive! Lives revived: ${TAttrsComp.revived_count}/${maxReviveCount}`);
|
||||
return reDate;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
fend?: number[];
|
||||
atking?: {s_uuid: number, t_num: number}[];
|
||||
atked?: {s_uuid: number, t_num: number}[];
|
||||
revive?: {s_uuid: number, r_num: number, upr: number}[];
|
||||
|
||||
// ==================== 特殊属性 ====================
|
||||
critical: number = 0; // 暴击率
|
||||
@@ -41,8 +42,7 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
puncture: number = 0; // 穿刺次数
|
||||
wfuny: number = 0; // 风怒
|
||||
|
||||
revive_count: number = 0; // 复活次数
|
||||
revive_time: number = 0; // 复活时间
|
||||
revived_count: number = 0; // 已复活次数
|
||||
invincible_time: number = 0;// 无敌时间
|
||||
|
||||
|
||||
@@ -245,10 +245,10 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
this.fend = undefined;
|
||||
this.atking = undefined;
|
||||
this.atked = undefined;
|
||||
this.revive = undefined;
|
||||
this.critical = 0;
|
||||
this.freeze_chance = 0;
|
||||
this.revive_count = 0;
|
||||
this.revive_time = 0;
|
||||
this.revived_count = 0;
|
||||
this.invincible_time = 0;
|
||||
this.puncture = 0;
|
||||
this.wfuny = 0;
|
||||
|
||||
@@ -389,27 +389,17 @@ export class HeroViewComp extends CCComp {
|
||||
alive(){
|
||||
// 重置复活标记 - 必须最先重置,否则status_change会被拦截
|
||||
this.model.is_reviving = false;
|
||||
|
||||
this.model.is_dead=false
|
||||
this.model.is_count_dead=false
|
||||
this.deadCD = 0;
|
||||
this.as.do_buff();
|
||||
this.status_change("idle");
|
||||
this.top_node.active=true
|
||||
this.setTopBarOpacity(false);
|
||||
this.lastBarUpdateTime=0
|
||||
// this.status_change("idle");
|
||||
// this.top_node.active=true
|
||||
// this.setTopBarOpacity(false);
|
||||
// this.lastBarUpdateTime=0
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 调度复活逻辑
|
||||
* @param delay 延迟时间(秒)
|
||||
*/
|
||||
scheduleRevive(delay: number) {
|
||||
this.scheduleOnce(() => {
|
||||
this.alive();
|
||||
}, delay);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 死亡视图表现
|
||||
|
||||
@@ -174,6 +174,7 @@ export class Monster extends ecs.Entity {
|
||||
model.fend = hero.fend;
|
||||
model.atking = hero.atking;
|
||||
model.atked = hero.atked;
|
||||
model.revive = hero.revive;
|
||||
|
||||
// 标记是否 Boss,非 Boss 默认记作杂兵
|
||||
model.is_boss =is_boss
|
||||
|
||||
Reference in New Issue
Block a user