减少复杂度,上阵英雄改为3个

This commit is contained in:
2024-12-27 09:56:14 +08:00
parent 79bda9f0db
commit 2231c5ceb1
5 changed files with 16 additions and 18 deletions

View File

@@ -50,4 +50,5 @@ export enum GameSet {
MON_COIN_ADD=2,
COIN_ADD=1,
DEF_RATE=0.5,
HERO_NUM=3,
}

View File

@@ -60,7 +60,7 @@ export const HeroInfo = {
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
//坦克,高闪避 反伤害
//坦克,高闪避 加闪避
5003: {
uuid:5003,name: "防御骑士",path:"k3",type:0,hp: 2000, hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:100,a_cd:1.5,
lvexp:0,slvexp:0,slv:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6005,6005,6005,6005,6005,6005],sk2:[6102,6102,6102,6102,6102,6102],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,

View File

@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { MissionHomeComp } from "../map/MissionHomeComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "../common/SingletonModuleComp";
import { GameSet } from "../common/config/BoxSet";
const { ccclass, property } = _decorator;
@@ -34,8 +35,8 @@ export class HeroSelectComp extends CCComp {
this.mhc_home.cancel_hero(this.h_uuid)
return
}
if(smc.fight_heros.length>= 5){
oops.gui.toast("英雄数量不能超过5个")
if(smc.fight_heros.length>= GameSet.HERO_NUM){
oops.gui.toast(`英雄数量不能超过 ${GameSet.HERO_NUM}`);
return
}
smc.fight_heros.push(this.h_uuid)

View File

@@ -4,7 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { HeroInfo, HeroList } from "../common/config/heroSet";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { UiHeroComp } from "../hero/UiHeroComp";
import { BoxSet } from "../common/config/BoxSet";
import { BoxSet, GameSet } from "../common/config/BoxSet";
import { smc } from "../common/SingletonModuleComp";
import { HeroSelect } from "../hero/HeroSelect";
import { MSklist, SkillSet } from "../common/config/SkillSet";
@@ -24,8 +24,6 @@ export class MissionHomeComp extends CCComp {
heros:any[]=[];
heros_pos:any=[
{uuid:0,px:100},
{uuid:0,px:0},
{uuid:0,px:-100},
{uuid:0,px:-200},
{uuid:0,px:-300},
@@ -48,8 +46,6 @@ export class MissionHomeComp extends CCComp {
}
this.heros=[]
this.heros_pos=[
{uuid:0,px:100},
{uuid:0,px:0},
{uuid:0,px:-100},
{uuid:0,px:-200},
{uuid:0,px:-300},
@@ -120,7 +116,7 @@ export class MissionHomeComp extends CCComp {
});
}
select_hero(h_uuid:number){
for(let i=0;i<=4;i++){
for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==0){
this.heros_pos[i].uuid=h_uuid
this.call_hero(h_uuid,i)
@@ -129,7 +125,7 @@ export class MissionHomeComp extends CCComp {
}
}
cancel_hero(h_uuid:number){
for(let i=0;i<=4;i++){
for(let i=0;i<GameSet.HERO_NUM;i++){
if(this.heros_pos[i].uuid==h_uuid){
this.heros_pos[i].uuid=0
this.destory_hero(h_uuid)