取消掉副英雄

This commit is contained in:
2025-07-14 16:53:39 +08:00
parent 0815d64f3c
commit fbcd12a5b9
19 changed files with 89 additions and 202 deletions

View File

@@ -42,15 +42,13 @@ export class SingletonModuleComp extends ecs.Comp {
hero:{
},
friend:{
},
boss:{
},
};
vmAdd() {
this.vmdata.mission_data=JSON.parse(JSON.stringify(MissionData))
this.vmdata.hero=JSON.parse(JSON.stringify(VmInfo))
this.vmdata.friend=JSON.parse(JSON.stringify(VmInfo))
this.vmdata.boss=JSON.parse(JSON.stringify(VmInfo))
VM.add(this.vmdata, "data");

View File

@@ -143,10 +143,8 @@ export const SuperCardsType={
}
export const CTarget={
MASTER:1, //主将
FRIEND:2, //友方
ALLY:3, //友方全体
ENEMY:4, //敌人
ALL:5, //所有
ENEMY:2, //敌人
ALL:3, //所有
}
export const Quality={
WHITE:1,

View File

@@ -87,17 +87,16 @@ export enum EquipSpecialAttr {
ICE=1, //冰系加成
FIRE=2, //火焰加成
WIND=3, //飓风加成
FRIEND_LIVE_CD=4, //伙伴复活时间减少
ATK_ADD_FRIEND_ATK=5, //攻击n次后增加伙伴攻击力
ATK_ADD_FRIEND_HP=6, //攻击n次后增加伙伴生命值
//FRIEND_LIVE_CD=4, //伙伴复活时间减少 已经放弃了,怕兼容问题暂时留着
//ATK_ADD_FRIEND_ATK=5, //攻击n次后增加伙伴攻击力
//ATK_ADD_FRIEND_HP=6, //攻击n次后增加伙伴生命值
ATK_ADD_GLOD=7, //攻击n次后增加金币
ATK_ADD_MASTER_ATK=8, //攻击n次后增加主将攻击力
ATK_ADD_MASTER_HP=9, //攻击n次后增加主将生命值
DOUBLE_DEAD=10, //额外死亡触发次数
//DOUBLE_DEAD=10, //额外死亡触发次数 伙伴系统已经取消,怕兼容问题暂时留着
DOUBLE_ATKED=11, //额外受击触发次数
FRIEND_ATKED_ADD_SKILL_STONE=12, //伙伴被攻击增加技能石
ATKED_ADD_SKILL_STONE=12, //被攻击增加技能石
ATK_ADD_VALUE=13, //攻击n次后触发属性增加的值 额外增加值
FRIEND_GET_MASTER_EQUIP=14, //伙伴获得主将装备属性加成
}
export enum Quality {
WHITE = 1,
@@ -1683,9 +1682,8 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["量子闪避者"],
info: "生命值+44%闪避44%免伤13%,伙伴双倍死亡触发",
info: "生命值+44%闪避44%免伤13%",
special_attr: [
{special_attr: EquipSpecialAttr.DOUBLE_DEAD, special_attr_value: 1},
],
buff: [
{ type: BuffAttr.HP, value: 44, target: EquipAttrTarget.HERO }, // HP+44%
@@ -1921,9 +1919,8 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["龙鳞反伤者"],
info: "生命值+108%反伤34%免伤13%,伙伴双倍受击触发",
info: "生命值+108%反伤34%免伤13%",
special_attr: [
{special_attr: EquipSpecialAttr.DOUBLE_ATKED, special_attr_value: 1},
],
buff: [
{ type: BuffAttr.HP, value: 108, target: EquipAttrTarget.HERO }, // HP+108%
@@ -2533,9 +2530,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["天穹戒指"],
info: "生命值+40%,免伤+15%,攻击触发属性增加额外加值+2",
info: "生命值+40%,免伤+15%,攻击触发属性增加额外加值+1",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_VALUE, special_attr_value: 2},
{special_attr: EquipSpecialAttr.ATK_ADD_VALUE, special_attr_value: 1},
],
buff: [
{ type: BuffAttr.HP, value: 40, target: EquipAttrTarget.HERO },
@@ -2549,9 +2546,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["天穹戒指"],
info: "生命值+44%,免伤+18%,攻击触发属性增加额外加值+4",
info: "生命值+44%,免伤+18%,攻击触发属性增加额外加值+2",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_VALUE, special_attr_value: 4},
{special_attr: EquipSpecialAttr.ATK_ADD_VALUE, special_attr_value: 2},
],
buff: [
{ type: BuffAttr.HP, value: 44, target: EquipAttrTarget.HERO },
@@ -2567,13 +2564,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["神木戒指"],
info: "攻击+44%,暴伤+30%伙伴获得主将装备属性加成10%",
info: "攻击+44%,暴伤+30%暴击+5%",
special_attr: [
{special_attr: EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP, special_attr_value: 10},
],
buff: [
{ type: BuffAttr.ATK, value: 44, target: EquipAttrTarget.HERO },
{ type: BuffAttr.CRITICAL_DMG, value: 30, target: EquipAttrTarget.HERO },
{ type: BuffAttr.CRITICAL, value: 5, target: EquipAttrTarget.HERO },
],
},
7542: {
@@ -2583,13 +2580,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["神木戒指"],
info: "攻击+50%,暴伤+34%伙伴获得主将装备属性加成20%",
info: "攻击+50%,暴伤+34%暴击+10%",
special_attr: [
{special_attr: EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP, special_attr_value: 20},
],
buff: [
{ type: BuffAttr.ATK, value: 50, target: EquipAttrTarget.HERO },
{ type: BuffAttr.CRITICAL_DMG, value: 34, target: EquipAttrTarget.HERO },
{ type: BuffAttr.CRITICAL, value: 10, target: EquipAttrTarget.HERO },
],
},
@@ -2601,10 +2598,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["日曜戒指"],
info: "生命值+36%,攻击+40%,攻击触发增加主将攻击力+2/生命值+10",
info: "生命值+36%,攻击+40%,攻击触发增加主将攻击力+1",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_ATK, special_attr_value: 2},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_HP, special_attr_value: 10},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_ATK, special_attr_value: 1},
],
buff: [
{ type: BuffAttr.HP, value: 36, target: EquipAttrTarget.HERO },
@@ -2618,10 +2614,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["日曜戒指"],
info: "生命值+40%,攻击+48%,攻击触发增加主将攻击力+4/生命值+20",
info: "生命值+40%,攻击+48%,攻击触发增加主将攻击力+2",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_ATK, special_attr_value: 4},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_HP, special_attr_value: 20},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_ATK, special_attr_value: 2},
],
buff: [
{ type: BuffAttr.HP, value: 40, target: EquipAttrTarget.HERO },
@@ -2637,10 +2632,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["月影项链"],
info: "免伤+16%,暴伤+28%,攻击触发增加伙伴攻击力+3/生命值+10",
info: "免伤+16%,暴伤+28%,攻击触发增加主将生命值5",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_FRIEND_ATK, special_attr_value: 3},
{special_attr: EquipSpecialAttr.ATK_ADD_FRIEND_HP, special_attr_value: 10},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_HP, special_attr_value: 5},
],
buff: [
{ type: BuffAttr.DEF, value: 16, target: EquipAttrTarget.HERO },
@@ -2654,10 +2648,9 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["月影项链"],
info: "免伤+18%,暴伤+32%,攻击触发增加伙伴攻击力+6/生命值+25",
info: "免伤+18%,暴伤+32%,攻击触发增加主将生命值10",
special_attr: [
{special_attr: EquipSpecialAttr.ATK_ADD_FRIEND_ATK, special_attr_value: 6},
{special_attr: EquipSpecialAttr.ATK_ADD_FRIEND_HP, special_attr_value: 25},
{special_attr: EquipSpecialAttr.ATK_ADD_MASTER_HP, special_attr_value: 10},
],
buff: [
{ type: BuffAttr.DEF, value: 18, target: EquipAttrTarget.HERO },
@@ -2673,13 +2666,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["星尘项链"],
info: "闪避+10%,攻击+44%伙伴复活时间减少30%",
info: "闪避+10%,攻击+44%技能冷却减少10%",
special_attr: [
{special_attr: EquipSpecialAttr.FRIEND_LIVE_CD, special_attr_value: 30},
],
buff: [
{ type: BuffAttr.DODGE, value: 10, target: EquipAttrTarget.HERO },
{ type: BuffAttr.ATK, value: 44, target: EquipAttrTarget.HERO },
{ type: BuffAttr.SKILL_CD, value: -10, target: EquipAttrTarget.HERO },
],
},
7545: {
@@ -2689,13 +2682,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["星尘项链"],
info: "闪避+12%,攻击+50%伙伴复活时间减少50%",
info: "闪避+12%,攻击+50%技能冷却减少20%",
special_attr: [
{special_attr: EquipSpecialAttr.FRIEND_LIVE_CD, special_attr_value: 50},
],
buff: [
{ type: BuffAttr.DODGE, value: 12, target: EquipAttrTarget.HERO },
{ type: BuffAttr.ATK, value: 50, target: EquipAttrTarget.HERO },
{ type: BuffAttr.SKILL_CD, value: -20, target: EquipAttrTarget.HERO },
],
},
@@ -2707,13 +2700,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 4,
path: EPath["深渊戒指"],
info: "反伤+12%,生命值+44%双倍死亡触发+1",
info: "反伤+12%,生命值+44%穿刺+1",
special_attr: [
{special_attr: EquipSpecialAttr.DOUBLE_DEAD, special_attr_value: 1},
],
buff: [
{ type: BuffAttr.REFLECT, value: 12, target: EquipAttrTarget.HERO },
{ type: BuffAttr.HP, value: 44, target: EquipAttrTarget.HERO },
{ type: BuffAttr.PUNCTURE, value: 1, target: EquipAttrTarget.HERO },
],
},
7546: {
@@ -2723,13 +2716,13 @@ export const EquipInfo: { [key: number]: EquipData } = {
quality: Quality.PURPLE,
lv: 5,
path: EPath["深渊戒指"],
info: "反伤+14%,生命值+50%双倍死亡触发+2",
info: "反伤+14%,生命值+50%穿刺+2",
special_attr: [
{special_attr: EquipSpecialAttr.DOUBLE_DEAD, special_attr_value: 2},
],
buff: [
{ type: BuffAttr.REFLECT, value: 14, target: EquipAttrTarget.HERO },
{ type: BuffAttr.HP, value: 50, target: EquipAttrTarget.HERO },
{ type: BuffAttr.PUNCTURE, value: 2, target: EquipAttrTarget.HERO },
],
},

View File

@@ -30,7 +30,7 @@ export enum GameEvent {
HeroSkillSelect = "HeroSkillSelect",
HeroSkillSelectEnd = "HeroSkillSelectEnd",
HeroSelect = "HeroSelect",
FriendCalled = "FriendCalled",
MasterCalled = "MasterCalled",
FightStart = "FightStart",
FightPause = "FightPause",
@@ -47,7 +47,6 @@ export enum GameEvent {
RefreshCard = "RefreshCard",
WaveUpdate = "WaveUpdate",
ChangeATK = "ChangeATK",
ChangeATK_FRIEND_LIVE_CD = "ChangeATK_FRIEND_LIVE_CD",
ChangeATK_EQUIP_SPECIAL_ATTR = "ChangeATK_EQUIP_SPECIAL_ATTR",
UpdateVMData = "UpdateVMData",
UpdateHP = "UpdateHP",

View File

@@ -273,8 +273,7 @@ export enum FightSet {
SKILL_WAVE_UP_2=5, //技能登场波次
SKILL_WAVE_UP_3=7, //技能登场波次
MON_WAVE_TIME=10,//怪物波次时间
FRIEND_LIVE_CD=10,//伙伴复活时间
ATK_ADD_FRIEND_COUNT=4,//伙伴攻击力增加
ATK_ADD_COUNT=4,//伙伴攻击力增加
ATK_ADD_GLOD=1,//金币增加
CRIT_DAMAGE=50,//暴击伤害
DOUBLE_ATK_RATE=100,//额外攻击默认概率

View File

@@ -157,7 +157,6 @@ uiManager.onPlayerSelectOption(0, options);
```typescript
// 在HeroViewComp.ts的to_update方法中添加
to_update() {
if(!this.is_master) return
// 原有的升级逻辑
oops.message.dispatchEvent(GameEvent.HeroLvUp,{lv:this.lv})

View File

@@ -9,6 +9,7 @@ import { HeroViewComp } from './HeroViewComp';
import { FightConComp } from '../map/FightConComp';
import { BuffAttr, DebuffAttr } from '../common/config/SkillSet';
import { GameEvent } from '../common/config/GameEvent';
import { FacSet } from '../common/config/BoxSet';
const { ccclass, property } = _decorator;
@ccclass('BuffComp')
@@ -89,8 +90,7 @@ export class BuffComp extends Component {
let buff=null
let info= null
if(!this.HeroView) return
if(this.HeroView.is_master) {info=smc.vmdata.hero;buff=this.FIGHTCON.hero_buff}
if(this.HeroView.is_friend) {info=smc.vmdata.friend;buff=this.FIGHTCON.friend_buff}
if(this.HeroView.fac==FacSet.HERO) {info=smc.vmdata.hero;buff=this.FIGHTCON.hero_buff}
if(this.HeroView.is_boss) {info=smc.vmdata.boss;buff=this.FIGHTCON.enemy_buff}
//if(this.HeroView.is_kalami) {target_key="enemy";buff_key="enemy"} 不显示小怪
if(info==null) return

View File

@@ -75,7 +75,6 @@ export class Hero extends ecs.Entity {
// const move = this.get(BattleMoveComp);
// move.direction = 1; // 向右移动
// move.targetX = 800; // 右边界'
oops.message.dispatchEvent(GameEvent.FriendCalled,{uuid:uuid})
}
hero_init(uuid:number=1001,node:Node,info:any={ap:0,hp:0,lv:1,crit:0,crit_d:0,dod:0,dod_no:false,crit_no:false}) {
var hv = node.getComponent(HeroViewComp)!;

View File

@@ -88,8 +88,6 @@ export class HeroViewComp extends CCComp {
stop_cd: number = 0; /*停止倒计时*/
speek_time:number = 0;
is_stop_temp:boolean = false
Friend_alive_cd:Timer=new Timer(10)
double_dead:boolean=false
double_atked:boolean=false
BUFF_DEFS: Array<{value: number, count: number}> = [] //防御提升
@@ -136,9 +134,7 @@ export class HeroViewComp extends CCComp {
}
/* 显示角色血量 */
this.node.getChildByName("top").getChildByName("hp").active = true;
if(this.is_friend){ //只有伙伴需要召唤后添加hp 怪物,和boss 不要设置减hp debuff 主要 一开始就战斗开始就存在,所以不需要
this.hp+=this.FIGHTCON.friend_buff.HP*this.hp_max/100
}
}
update(dt: number){
if(!smc.mission.play||smc.mission.pause) return
@@ -146,13 +142,7 @@ export class HeroViewComp extends CCComp {
// this.ent.destroy();
// return
// }
if(this.is_dead) {
// console.log("[HeroViewComp]:alive friend cd",this.Friend_alive_cd ,this.Friend_alive_cd.elapsedTime)
if(this.Friend_alive_cd.update(dt)){
this.to_alive()
}
}
if(this.timer.update(dt)){
// this.add_ap(10)
};
@@ -291,23 +281,12 @@ export class HeroViewComp extends CCComp {
}
}
}
master_count_atk_count(){ //主将攻击次数 主要有装备加成,需要单独处理
count_atk_count(){ //主将攻击次数 主要有装备加成,需要单独处理
if(!this.is_master) return
this.atk_count+=1
if(this.atk_count< FightSet.ATK_ADD_FRIEND_COUNT) return
if(this.atk_count< FightSet.ATK_ADD_COUNT) return
if(this.FIGHTCON.atk_add_glod >0) smc.vmdata.mission_data.gold+=this.FIGHTCON.atk_add_glod
let friends=ecs.query(ecs.allOf(FriendModelComp))
friends.forEach(friend=>{
let friend_view=friend.get(HeroViewComp)
if(this.FIGHTCON.atk_add_friend_atk>0) {
friend_view.add_ap(this.FIGHTCON.atk_add_friend_atk)
}
if(this.FIGHTCON.atk_add_friend_hp>0) {
friend_view.add_hp_max(this.FIGHTCON.atk_add_friend_hp)
}
})
let master=ecs.query(ecs.allOf(MasterModelComp))
master.forEach(master=>{
@@ -323,19 +302,12 @@ export class HeroViewComp extends CCComp {
this.atk_count=0
}
friend_count_atk_count(){ //伙伴攻击次数 有装备加成,需要单独处理
if(this.is_master) return
if(this.atk_add_count==0) return
this.atk_count+=1
if(this.atk_count < this.atk_add_count) return
}
do_dead(){
this.do_dead_trigger()
this.Friend_alive_cd=new Timer(this.FIGHTCON.friend_alive_cd)
console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
if(this.fac==FacSet.MON){
@@ -349,7 +321,7 @@ export class HeroViewComp extends CCComp {
}
}
if(this.is_master){
if(this.fac==FacSet.HERO){
console.log("[HeroViewComp]:英雄死亡")
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
}
@@ -358,8 +330,7 @@ export class HeroViewComp extends CCComp {
}
get_buff(){
let buff=null
if(this.is_master) buff=this.FIGHTCON.hero_buff
if(this.is_friend) buff=this.FIGHTCON.friend_buff
if(this.fac==FacSet.HERO) buff=this.FIGHTCON.hero_buff
if(this.is_boss) buff=this.FIGHTCON.enemy_buff
if(this.is_kalami) buff=this.FIGHTCON.enemy_buff
if(buff==null) return
@@ -572,16 +543,12 @@ export class HeroViewComp extends CCComp {
do_dead_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
let count = 1
if(this.double_dead) {
console.log("[HeroViewComp]:double_dead")
count =2
}
for(let i=0;i<count;i++){
console.log("[HeroViewComp]:dead"+i+"次")
}
}
do_atked_trigger(){
if(this.is_dead||this.fac==FacSet.MON||this.is_master) return
if(this.is_dead||this.fac==FacSet.MON) return
let count = 1
if(this.double_atked) {
console.log("[HeroViewComp]:double_atked")
@@ -598,13 +565,13 @@ export class HeroViewComp extends CCComp {
}
).start()
}
to_alive(){
this.is_dead=false
this.hp=this.hp_max*(100+this.buff_hp)/100
this.BUFFCOMP.vmdata_update(true)
this.node.setPosition(HeroPos[this.fight_pos].pos)
this.BUFFCOMP.heathed()
}
// to_alive(){
// this.is_dead=false
// this.hp=this.hp_max*(100+this.buff_hp)/100
// this.BUFFCOMP.vmdata_update(true)
// this.node.setPosition(HeroPos[this.fight_pos].pos)
// this.BUFFCOMP.heathed()
// }
//掉落物品
to_drop(){
// let Drops = getMonsterDrops(1, MonsterType.Normal, 1.2);

View File

@@ -52,15 +52,12 @@ export class SkillConComp extends CCComp {
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) this.HeroView.at += dt;
let cd = this.get_cd(this.HeroView.cd,this.HeroView)
// console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 准备释放")+SkillSet[this.HeroView.atk_skill].name+"=>"+"=>cd:"+cd+"=> count:"+count)
if (this.HeroView.is_atking &&(this.HeroView.at > cd)) {
if(this.HeroView.is_dead) return
const config = SkillSet[this.HeroView.atk_skill];
if (!config) return;
// console.log(this.HeroView.hero_name+(this.HeroView.is_master?"[主]":"[从] 释放")+"=>"+config.name+"=>"+count)
this.castSkill(config,this.check_wfuny());
this.HeroView.master_count_atk_count()
this.HeroView.friend_count_atk_count()
this.HeroView.count_atk_count()
this.HeroView.at = 0;
}
if (this.aoe_queues.length > 0) {
@@ -339,7 +336,6 @@ export class SkillConComp extends CCComp {
get_buff(view:HeroViewComp){
if(view.is_master) return this.FIGHTCON.hero_buff
if(view.is_friend) return this.FIGHTCON.friend_buff
if(view.is_boss||view.is_kalami) return this.FIGHTCON.enemy_buff
return null
}

View File

@@ -23,7 +23,6 @@ export class BarCompComp extends CCComp {
/** 视图层逻辑代码分离演示 */
protected onLoad(): void {
this.on(GameEvent.FightReady,this.readay,this)
this.on(GameEvent.FriendCalled,this.friend_called,this)
this.on(GameEvent.MasterCalled,this.master_called,this)
this.on(GameEvent.APChange,this.ap_change,this)
@@ -48,15 +47,7 @@ export class BarCompComp extends CCComp {
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[data.uuid].path);
});
}
private friend_called(e:any,data:any){
this.node.getChildByName("fbar").active=true
let show=this.node.getChildByName("fbar").getChildByName("hero")
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = show.getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[data.uuid].path);
});
}
private ap_change(e:any,data:any){
console.log("[barcomp]:ap_change",data)
if(data.is_master==true){

View File

@@ -16,7 +16,6 @@ export class EquipsComp extends Component {
boxs:Node=null
attrs:any={
hero_buff:getBuffNum(),
friend_buff:getBuffNum(),
enemy_buff:getBuffNum(),
}
/** 视图层逻辑代码分离演示 */
@@ -228,7 +227,6 @@ export class EquipsComp extends Component {
const all_special_attr=[...weapon_special_attr,...armor_special_attr,...accessory_special_attr]
let equip_special_attr=this.count_equip_special_attr(all_special_attr)
let friend_get_master_equip=equip_special_attr[EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP]
oops.message.dispatchEvent(GameEvent.ChangeATK_EQUIP_SPECIAL_ATTR,equip_special_attr)
// 合并所有装备属性
@@ -243,15 +241,9 @@ export class EquipsComp extends Component {
case EquipAttrTarget.HERO:
targetKey = 'hero_buff';
break;
case EquipAttrTarget.FRIEND:
targetKey = 'friend_buff';
break;
}
this.add_attr(targetKey,attr)
});
// 伙伴获取英雄装备属性加成
this.attrs.friend_buff.ATK+=this.attrs.hero_buff.ATK*friend_get_master_equip
this.attrs.friend_buff.HP+=this.attrs.hero_buff.HP*friend_get_master_equip
console.log("[EquipsComp]:debuff buff attrs ", this.attrs);
oops.message.dispatchEvent(GameEvent.EquipChange, this.attrs);
@@ -263,17 +255,12 @@ export class EquipsComp extends Component {
[EquipSpecialAttr.ICE]: 0,
[EquipSpecialAttr.FIRE]: 0,
[EquipSpecialAttr.WIND]: 0,
[EquipSpecialAttr.FRIEND_LIVE_CD]: 0,
[EquipSpecialAttr.ATK_ADD_FRIEND_ATK]: 0,
[EquipSpecialAttr.ATK_ADD_FRIEND_HP]: 0,
[EquipSpecialAttr.ATK_ADD_GLOD]: 0,
[EquipSpecialAttr.ATK_ADD_MASTER_ATK]: 0,
[EquipSpecialAttr.ATK_ADD_MASTER_HP]: 0,
[EquipSpecialAttr.DOUBLE_DEAD]: 0,
[EquipSpecialAttr.DOUBLE_ATKED]: 0,
[EquipSpecialAttr.FRIEND_ATKED_ADD_SKILL_STONE]: 0,
[EquipSpecialAttr.ATKED_ADD_SKILL_STONE]: 0,
[EquipSpecialAttr.ATK_ADD_VALUE]: 0,
[EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP]: 0,
};
console.log("[EquipsComp]:all_special_attr",all_special_attr)
@@ -302,7 +289,6 @@ export class EquipsComp extends Component {
// 创建新的属性对象
const newAttrs = {
hero_buff: getBuffNum(),
friend_buff: getBuffNum(),
enemy_buff: getBuffNum(),
};
@@ -311,7 +297,6 @@ export class EquipsComp extends Component {
console.log("重置属性", {
hero_buff: this.attrs.hero_buff,
friend_buff: this.attrs.friend_buff,
enemy_buff: this.attrs.enemy_buff,
});
}

View File

@@ -17,24 +17,18 @@ const { ccclass, property } = _decorator;
export class FightConComp extends Component {
//装备 及 光环效果 物品存在生效 enemy_buff 是针对 怪物的debuff 偶尔也有buff 需要注意
hero_buff=getBuffNum()
friend_buff=getBuffNum()
enemy_buff=getBuffNum()
//注意临时buff和debuff 每种buff的值 必须都一样 多种值 战斗处理复杂 暂时放弃
atk_type:number=0;
//装备特殊属性 触发后 局内永久生效
friend_alive_cd:number=FightSet.FRIEND_LIVE_CD
atk_add_friend_atk:number=0
atk_add_friend_hp:number=0
atk_add_glod:number=0
atk_add_master_atk:number=0
atk_add_master_hp:number=0
double_dead:number=0
double_atked:number=0
friend_atked_add_skill_stone:number=0
atked_add_skill_stone:number=0
atk_add_value:number=0
friend_get_master_equip:number=0
//卡牌特效
card_atk_add:number=0 //卡牌特效 攻击提高攻击力效果 额外添加值
@@ -56,50 +50,34 @@ export class FightConComp extends Component {
}
protected start(): void {
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD
}
change_equip_special_attr(e:GameEvent,data:any){
console.log("[FightConComp]:change_equip_special_attr",data)
this.atk_add_value=data[EquipSpecialAttr.ATK_ADD_VALUE]
this.atk_add_friend_atk=data[EquipSpecialAttr.ATK_ADD_FRIEND_ATK]+this.atk_add_value+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
this.atk_add_friend_hp=data[EquipSpecialAttr.ATK_ADD_FRIEND_HP]+this.atk_add_value+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
this.atk_add_glod=data[EquipSpecialAttr.ATK_ADD_GLOD]
this.atk_add_master_atk=data[EquipSpecialAttr.ATK_ADD_MASTER_ATK]+this.atk_add_value+(this.card_atk_add > 0 ? this.card_atk_add:0) //装备特殊属性 英雄/伙伴 攻击力增加
this.atk_add_master_hp=data[EquipSpecialAttr.ATK_ADD_MASTER_HP]+this.atk_add_value+(this.card_hp_add > 0 ? this.card_hp_add:0) //装备特殊属性 英雄/伙伴 生命值增加
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD-data[EquipSpecialAttr.FRIEND_LIVE_CD]
this.double_dead=data[EquipSpecialAttr.DOUBLE_DEAD]
this.double_atked=data[EquipSpecialAttr.DOUBLE_ATKED]
this.friend_atked_add_skill_stone=data[EquipSpecialAttr.FRIEND_ATKED_ADD_SKILL_STONE]
this.friend_get_master_equip=data[EquipSpecialAttr.FRIEND_GET_MASTER_EQUIP]
this.atked_add_skill_stone=data[EquipSpecialAttr.ATKED_ADD_SKILL_STONE]
}
private equip_change(e:GameEvent,equip:any){
let old_hero_hp=JSON.parse(JSON.stringify(this.hero_buff.HP))
let old_friend_hp=JSON.parse(JSON.stringify(this.friend_buff.HP))
let new_hero_hp=JSON.parse(JSON.stringify(equip.hero_buff.HP))
let new_friend_hp=JSON.parse(JSON.stringify(equip.friend_buff.HP))
this.hero_buff=equip.hero_buff
this.friend_buff=equip.friend_buff
this.enemy_buff=equip.enemy_buff
let hero_hp_add=new_hero_hp-old_hero_hp
let friend_hp_add=new_friend_hp-old_friend_hp
console.log("[FightConComp]:old_hero_hp:"+old_hero_hp+" new_hero_hp:"+new_hero_hp+" hero_hp_add:"+hero_hp_add)
if(hero_hp_add!==0){
oops.message.dispatchEvent(GameEvent.UpdateHP,{hp:hero_hp_add,is_master:true})
}
if(friend_hp_add!==0){
oops.message.dispatchEvent(GameEvent.UpdateHP,{hp:friend_hp_add,is_master:false})
}
this.scheduleOnce(()=>{
oops.message.dispatchEvent(GameEvent.UpdateVMData)
},0.1)
@@ -148,21 +126,13 @@ export class FightConComp extends Component {
private clearAlls() {
this.hero_buff=getBuffNum()
this.friend_buff=getBuffNum()
this.enemy_buff=getBuffNum()
this.friend_alive_cd=FightSet.FRIEND_LIVE_CD
this.atk_add_friend_atk=0
this.atk_add_friend_hp=0
this.atk_add_glod=0
this.atk_add_master_atk=0
this.atk_add_master_hp=0
this.double_dead=0
this.double_atked=0
this.friend_atked_add_skill_stone=0
this.atked_add_skill_stone=0
this.atk_add_value=0
this.friend_get_master_equip=0
this.card_atk_add=0
this.card_hp_add=0

View File

@@ -51,11 +51,11 @@ export class MissionComp extends CCComp {
private on_mon_wave_update(){
smc.vmdata.mission_data.current_wave++
let wave=smc.vmdata.mission_data.current_wave
if(wave==FightSet.FRIEND_WAVE_UP){
console.log("[任务系统] FRIEND_WAVE_UP 伙伴选择 :",wave,FightSet.FRIEND_WAVE_UP)
let node= this.node.getChildByName("new_hero")
tween(node).to(0.3, {position:v3(280,node.position.y,1)}).start()
}
// if(wave==FightSet.FRIEND_WAVE_UP){
// console.log("[任务系统] FRIEND_WAVE_UP 伙伴选择 :",wave,FightSet.FRIEND_WAVE_UP)
// let node= this.node.getChildByName("new_hero")
// tween(node).to(0.3, {position:v3(280,node.position.y,1)}).start()
// }
}
@@ -163,9 +163,10 @@ export class MissionComp extends CCComp {
private cleanComponents() {
ecs.query(ecs.allOf(HeroViewComp)).forEach(entity => {entity.remove(HeroViewComp);entity.destroy()});
}
hide_call_friend(){
let node =this.node.getChildByName("new_hero")
tween(node).to(0.3, {position:v3(480,node.position.y,1)}).start()
// let node =this.node.getChildByName("new_hero")
// tween(node).to(0.3, {position:v3(480,node.position.y,1)}).start()
}
/** 视图层逻辑代码分离演示 */

View File

@@ -18,7 +18,6 @@ const { ccclass, property } = _decorator;
@ecs.register('MissionHeroComp', false)
export class MissionHeroCompComp extends CCComp {
timer:Timer=new Timer(2)
Friend_alive_cd:Timer=new Timer(10)
Friend_is_dead:boolean=false
current_hero_uuid:number=0
onLoad(){
@@ -33,15 +32,10 @@ export class MissionHeroCompComp extends CCComp {
this.node.getChildByName("location").active=false
}
fight_ready(){
this.Friend_alive_cd=new Timer(FightSet.FRIEND_LIVE_CD)
}
protected update(dt: number): void {
if(smc.mission.status != 1) return
if(this.Friend_is_dead){
if(this.Friend_alive_cd.update(dt)){
console.log("alive friend")
}
}
}
@@ -52,10 +46,7 @@ export class MissionHeroCompComp extends CCComp {
console.log("[MissionHeroComp]:zhaohuan",args)
this.addHero(args.uuid,false,true)
}
up_friend_alive_cd(less:number){
}
private call_friend(event: string, args: any,is_master:boolean=false){
console.log("[MissionHeroComp]:call_hero addHero",args.uuid,is_master)
let hero_pos=1

View File

@@ -130,7 +130,6 @@ export class Skill extends ecs.Entity {
let frost_time=0
let frost_ratto=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
if(view.is_kalami) buff=FIGHTCON.enemy_buff
if(buff!==null) {

View File

@@ -183,7 +183,6 @@ export class SkillCom extends CCComp {
let debuff = {deV:0,deC:0,deR:0}
let buff=null
if(this.caster.is_master) buff = this.FIGHTCON.hero_buff
if(this.caster.is_friend) buff = this.FIGHTCON.friend_buff
if(this.caster.is_boss||this.caster.is_kalami) buff = this.FIGHTCON.enemy_buff
if(buff==null) return debuff
debuff.deV=buff.DEBUFF_VALUE