This commit is contained in:
2025-05-27 10:57:42 +08:00
parent 424edb89a7
commit cdb09a5ca1
13 changed files with 867 additions and 555 deletions

View File

@@ -11,8 +11,8 @@ export const BossList = {
}
}
export const MissionNum = 3 //对应关卡数MissionSet 的索引
export const MissionSet = [
export const MissionNum = 3 //对应关卡数MissionMons 的索引
export const MissionMons = [
[5201,5202,5203,5204,5205,5206,5210,5211,5212],
[5213,5214,5215],
[5201],
@@ -52,3 +52,17 @@ export const MissStatus = {
choose:3,
end:4,
}
export enum FightSet {
ATK_TO_ATK_RATIO=0.1,
ATK_TO_HP_RATIO=0.2,
ATK_TO_SHIELD_RATIO=2,
ATK_LINES = 3, //英雄数
MON_GOLD_ADD =2,
MON_COIN_ADD=2,
COIN_ADD=1,
DEF_RATE=0.7,
DODGE_MAX=70,
HERO_NUM=3,
AP_UPDATE_RATE=100,
AP_CHANGE_RATE=0,
}

View File

@@ -2,7 +2,7 @@
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "1a81eb9e-feb4-483f-a5c0-ca5f0b358627",
"uuid": "26aee2e6-ab33-4155-a0aa-221c6be8d030",
"files": [],
"subMetas": {},
"userData": {}

View File

@@ -39,13 +39,19 @@ export class BuffComp extends Component {
info_init(){
this.top_node = this.node.getChildByName("top");
this.top_node.getChildByName("lv").active=(this.node.getComponent(HeroViewComp).fac == 0 ? true : false)
// this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false)
this.top_node.getChildByName("sboss").active=this.node.getComponent(HeroViewComp).is_boss
this.top_node.getChildByName("lv").getChildByName("lv").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).lv.toFixed(0)
this.top_node.getChildByName("ihp").getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).hp.toFixed(0)
this.top_node.getChildByName("iap").getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).ap.toFixed(0)
this.top_node.getChildByName("ihp").active=false
this.top_node.getChildByName("iap").active=false
}
update(deltaTime: number) {
if(smc.mission.pause) return
// this.hp_show()
this.hp_show()
if(this.wind_cd > 0 ) this.wind_cd -= deltaTime;
if(this.wind_cd <= 0 && this.node.getChildByName("wind").active){
this.node.getChildByName("wind").active = false;
@@ -55,25 +61,16 @@ export class BuffComp extends Component {
if(this.buff_cd <= 0 && this.node.getChildByName("buff").active){
this.node.getChildByName("buff").active = false;
}
this.in_speek(deltaTime)
}
hp_show(){
if(this.node.getComponent(HeroViewComp).fac == 0) {
this.top_node.getChildByName("hp").active = false;
this.update_info_hp()
}else{
this.top_node.getChildByName("lv").active = true;
let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max;
this.top_node.getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.node.getComponent(HeroViewComp).is_boss) return
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
}
// if(this.node.getComponent(HeroViewComp).fac == 0) return
let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max;
this.top_node.getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
if(this.node.getComponent(HeroViewComp).is_boss) return
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
}
show_shield(val:boolean){
this.node.getChildByName("shielded").active=val
@@ -89,7 +86,10 @@ export class BuffComp extends Component {
iap_node.getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).ap.toFixed(0)
}
update_info_lv(){
let lv_node = this.top_node.getChildByName("lv");
lv_node.getChildByName("lv").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).lv.toFixed(0)
}
show_wind(t:number=1){
this.wind_cd = t;

View File

@@ -53,6 +53,7 @@ export class Hero extends ecs.Entity {
hv.dis = hero.dis;
hv.hp= hv.hp_max =hero.hp+info.hp;
hv.ap = hero.ap+info.ap;
hv.lv=info.lv+1
hv.cd = hero.a_cd
hv.ap_u=hero.ap_u
hv.ap_ur=hero.ap_ur

View File

@@ -2,7 +2,7 @@ import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,insta
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroSpine } from "./HeroSpine";
import { BoxSet, GameSet } from "../common/config/BoxSet";
import { BoxSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp";
import { Skill } from "../skills/Skill";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
@@ -247,11 +247,18 @@ export class HeroViewComp extends CCComp {
}
do_change(){
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.update_info_lv()
}
do_update(){
this.BUFFCOMP.update_info_ap()
this.BUFFCOMP.update_info_hp()
this.BUFFCOMP.update_info_lv()
}
do_dead(){
}
@@ -273,7 +280,7 @@ export class HeroViewComp extends CCComp {
if(this.ent == null) return;
this.ent.destroy();
}
this.BUFFCOMP.hp_show()
this.BUFFCOMP.update_info_hp()
this.showDamage(remainingDamage, true);
}
}

View File

@@ -6,7 +6,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { HeroModelComp } from "../hero/HeroModelComp";
import { BoxSet } from "../common/config/BoxSet";
import { MonModelComp } from "../hero/MonModelComp";
import { Missions,} from "../common/config/MissionSet";
import { Missions} from "../common/config/Mission";
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
import { VictoryComp } from "./VictoryComp";
import { MSkillComp } from "./MSkillComp";

View File

@@ -1,7 +1,7 @@
import { _decorator, resources, Sprite, SpriteAtlas, SpriteFrame, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { BoxSet, GameSet } from "../common/config/BoxSet";
import { BoxSet, } from "../common/config/BoxSet";
import { HeroInfo, HeroList, HeroPos, HeroSet, HeroUpInfo } from "../common/config/heroSet";
import { Hero } from "../hero/Hero";
import { smc } from "../common/SingletonModuleComp";
@@ -11,6 +11,7 @@ import { GameEvent } from "../common/config/GameEvent";
import { HeroModelComp } from "../hero/HeroModelComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { oops } from "db://oops-framework/core/Oops";
import { FightSet } from "../common/config/Mission";
const { ccclass, property } = _decorator;
@@ -113,23 +114,34 @@ export class MissionHeroCompComp extends CCComp {
for(let hero of heros){
if(hero.get(HeroViewComp).fight_pos==fight_pos){
let hv = hero.get(HeroViewComp)
let AP_UP_RATE = hv.hero_uuid === uuid ? GameSet.AP_UPDATE_RATE : GameSet.AP_CHANGE_RATE;
let heroUpData = HeroUpInfo[hv.hero_uuid] || {}
let o_ap_rate = heroUpData.ap_up_rate || 0 //被替换 升级的英雄额外被替换攻击增长比率
let o_ap = heroUpData.ap_up || 0 //被替换 升级的英雄额外被替换攻击增长值
let s_ap_rate = (HeroUpInfo[uuid] || {}).ap_up_rate || 0 //替换 升级的英雄额外替换攻击增长比率
let s_ap = (HeroUpInfo[uuid] || {}).ap_up || 0 //替换 升级的英雄额外替换攻击增长值
let o_hp_up = heroUpData.hp_up || 0 //被替换 升级的英雄额外被替换血量增长值
let s_hp_up = (HeroUpInfo[uuid] || {}).hp_up || 0 //替换 升级的英雄额外替换血量增长值
info.ap=Math.floor(hv.ap*(AP_UP_RATE+o_ap_rate+s_ap_rate)/100+o_ap+s_ap)
info.hp=Math.floor(o_hp_up+s_hp_up)
info.lv=hv.lv
// let AP_UP_RATE = hv.hero_uuid === uuid ? FightSet.AP_UPDATE_RATE : FightSet.AP_CHANGE_RATE;
// let heroUpData = HeroUpInfo[hv.hero_uuid] || {}
// let o_ap_rate = heroUpData.ap_up_rate || 0 //被替换 升级的英雄额外被替换攻击增长比率
// let o_ap = heroUpData.ap_up || 0 //被替换 升级的英雄额外被替换攻击增长值
// let s_ap_rate = (HeroUpInfo[uuid] || {}).ap_up_rate || 0 //替换 升级的英雄额外替换攻击增长比率
// let s_ap = (HeroUpInfo[uuid] || {}).ap_up || 0 //替换 升级的英雄额外替换攻击增长值
// let o_hp_up = heroUpData.hp_up || 0 //被替换 升级的英雄额外被替换血量增长值
// let s_hp_up = (HeroUpInfo[uuid] || {}).hp_up || 0 //替换 升级的英雄额外替换血量增长值
// info.ap=Math.floor(hv.ap*(AP_UP_RATE+o_ap_rate+s_ap_rate)/100+o_ap+s_ap)
// info.hp=Math.floor(o_hp_up+s_hp_up)
if(hv.hero_uuid === uuid){
info.ap=hv.ap
info.hp=hv.hp_max
info.lv=hv.lv
}else{
this.do_hero_change()
}
hero.destroy()
return info
}
}
return info
}
do_hero_change(){
//金币加1
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
// this.node.destroy();

View File

@@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { Monster } from "../hero/Mon";
import { BoxSet } from "../common/config/BoxSet";
import { HeroSet, MonSet } from "../common/config/heroSet";
import { Missions } from "../common/config/MissionSet";
import { Missions } from "../common/config/Mission";
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { smc } from "../common/SingletonModuleComp";

View File

@@ -5,7 +5,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { smc } from "../common/SingletonModuleComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { MissionReward } from "../common/config/MissionSet";
import { MissionReward } from "../common/config/Mission";
import { Items } from "../common/config/Items";
import { Item } from "./Item";
import { UIID } from "../common/config/GameUIConfig";