This commit is contained in:
2025-08-05 17:25:34 +08:00
parent 3db3cc78eb
commit 6f9529ada2
20 changed files with 3120 additions and 1623 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,303 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "hartanm",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 8,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 1,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 11
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.VectorTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channels": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
}
],
"_nComponents": 3
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
"position"
]
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 4
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.25,
0.75,
1
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 6
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.25,
0.75,
1
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 5,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -5,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 8
}
},
{
"__type__": "cc.RealCurve",
"_times": [
0,
0.25,
0.75,
1
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": {
"tangentMode": 0
}
}
],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 10
}
},
{
"__type__": "cc.RealCurve",
"_times": [],
"_values": [],
"preExtrapolation": 1,
"postExtrapolation": 1
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "85cb96f6-0d73-498f-83e8-c733d2ba8634",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "hartanm"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -14,11 +14,11 @@ const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Root {
start() {
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
// EPhysics2DDrawFlags.Pair |
// EPhysics2DDrawFlags.CenterOfMass |
// EPhysics2DDrawFlags.Joint |
// EPhysics2DDrawFlags.Shape;
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
EPhysics2DDrawFlags.Pair |
EPhysics2DDrawFlags.CenterOfMass |
EPhysics2DDrawFlags.Joint |
EPhysics2DDrawFlags.Shape;
}
protected async run() {
smc.initialize = ecs.getEntity<Initialize>(Initialize);

View File

@@ -111,7 +111,7 @@ export function getRandomCardsByType(
let cardList: number[] = [];
switch (type) {
case cardType.HERO:
cardList = getHeroList(data); //hero选项是1和0 1是主将
cardList = getHeroList(); //hero选项是1和0 1是主将
break;
case cardType.SKILL:
cardList = getSkills(data); // 技能时 data是品质

View File

@@ -12,6 +12,7 @@ export enum GameEvent {
/** 登陆成功 */
LoginSuccess = "LoginSuccess",
MSSelected = "MSSelected",
LifeChange = "LifeChange",
CastSkill = "CastSkill",
CardsClose = "CardsClose",
CardRefresh = "CardRefresh",

View File

@@ -72,6 +72,7 @@ export enum FightSet {
DOWN_TIME=5,//倒计时时间
MORE_RC=10,//更多次数 广告获取的次数
TAL_NUM=3,//天赋数量
HEARTPOS=-240,//基地位置
// ATK_TO_ATK_RATIO=0.1,
// ATK_TO_HP_RATIO=0.2,
// ATK_TO_SHIELD_RATIO=2,

View File

@@ -28,19 +28,16 @@ export enum HType {
mage = 2,
}
export const getHeroList = (is_master:number=0)=>{
if(is_master==1){
export const getHeroList = ()=>{
return Masters
}else{
return HeroList
}
}
export const HeroList = [5021,5022,5023,5024,5025,5026,5027,5028]
export const MonList = [5201,5202,5203,5204,5205,5206,5219,5220,5221,5222,5223,5224,5225,5226,5227]
export const Masters = [5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012]
export const HeroPos={
0:{pos:v3(-160,0,0)},
0:{pos:v3(-290,0,0)},
1:{pos:v3(0,0,0)},
2:{pos:v3(-100,0,0)},
}
@@ -241,50 +238,50 @@ export const HeroInfo = {
//主将
5001:{uuid:5001,name:"刺心.艾吉斯",path:"k1", quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6001,6004,6004],
type:HType.warrior,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6001,6004,6004],
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
5002:{uuid:5002,name:"飓风.格罗姆",path:"k2", quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6001,6005,6005],
type:HType.warrior,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6001,6005,6005],
buff:[],info:"斧类专精,风怒概率增加10%"},
5003:{uuid:5003,name:"碎颅.赫克托",path:"k4", quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6001,6021,6001],
type:HType.warrior,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6001,6021,6001],
buff:[],info:"锤类专精,暴击概率增加10%"},
5004:{uuid:5004,name:"裂伤.塔米拉",path:"k3", quality:HQuality.BLUE,lv:1,kind:1,
type:HType.warrior,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6001,6021,6001],
type:HType.warrior,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6001,6021,6001],
buff:[],info:"刀类专精,易伤效果额外持续1次"},
5005:{uuid:5005,name:"幽灵射手",path:"a4", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.remote,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6003,6003,6003],
type:HType.remote,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6003,6003,6003],
buff:[],info:"说明"},
5006:{uuid:5006,name:"战争领主",path:"k5", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.warrior,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6002,6002,6002],
type:HType.warrior,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6002,6002,6002],
buff:[],info:"说明"},
5007:{uuid:5007,name:"混沌法师",path:"zh1", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6002,6002,6002],
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6002,6002,6002],
buff:[],info:"说明"},
5008:{uuid:5008,name:"火焰法师",path:"zh2", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6002,6002,6002],
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6002,6002,6002],
buff:[],info:"说明"},
5009:{uuid:5009,name:"风暴精灵",path:"m4", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6002,6002,6002],
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6002,6002,6002],
buff:[],info:"说明"},
5010:{uuid:5010,name:"战争祭祀",path:"d2", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.mage,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6002,6002,6002],
type:HType.mage,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6002,6002,6002],
buff:[],info:"说明"},
5011:{uuid:5011,name:"暴风射手",path:"a5", quality:HQuality.BLUE,lv:1,kind:2,
type:HType.remote,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6003,6003,6003],
type:HType.remote,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6003,6003,6003],
buff:[],info:"说明"},
5012:{uuid:5012,name:"苍穹射手",path:"a3", quality:HQuality.BLUE,lv:1,kind:1,
type:HType.remote,hp:100,ap:15,dis:600,cd:1.5,speed:50,skills:[6003,6003,6003],
type:HType.remote,hp:100,ap:15,dis:400,cd:1.5,speed:50,skills:[6003,6003,6003],
buff:[],info:"说明"},

View File

@@ -2,7 +2,10 @@ import { HeroViewComp } from "../../../hero/HeroViewComp";
import { BattleMoveComp } from "./BattleMoveComp";
import { ecs } from "../../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { smc } from "../../SingletonModuleComp";
import { BoxSet } from "../../config/BoxSet";
import { BoxSet, FacSet } from "../../config/BoxSet";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../../config/GameEvent";
import { FightSet } from "../../config/Mission";
@ecs.register('BattleMoveSystem')
export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
@@ -25,18 +28,19 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
// 同步状态
if (!shouldStop&&view.fac==1) { //在攻击范围内停止移动 取消这个判断
if (!shouldStop) { //在攻击范围内停止移动 取消这个判断
// if(view.fac==1){
if(view.is_stop||view.is_dead||view.DEBUFF_STUN>0 ||view.DEBUFF_FROST>0) return //停止移动或者死亡不移动
// 新增墓地位置判断,如果已经在墓地则不再移动
if (view.node.position.x === -1000 || view.node.position.x === 1000) {
return;
}
// 计算移动量
const delta = ((view.speed-view.DEBUFF_SLOW)/3) * this.dt * move.direction;
const newX = view.node.position.x + delta;
view.status_change("move")
// 新增墓地位置判断,如果已经在墓地则不再移动
if (view.node.position.x === -1000 || view.node.position.x === 1000) {
return;
}
// 限制移动范围
if (this.validatePosition(newX, move)) {
view.node.setPosition(newX, view.node.position.y, 0);
@@ -45,7 +49,7 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
else{
view.status_change("idle")
}
this.checkEnemiesInBase(e)
// console.log(`[${view.hero_name}] 类型:${view.type} 是否停止:${shouldStop} 方向:${move.direction} 位置:${view.node.position.x.toFixed(1)}`);
}
@@ -58,8 +62,22 @@ export class BattleMoveSystem extends ecs.ComblockSystem implements ecs.ISystemU
newX >= move.targetX;
}
/** 检测是否在墓地 */
private checkInGrave(entity: ecs.Entity): boolean {
const view = entity.get(HeroViewComp);
return view.node.position.x === -1000 || view.node.position.x === 1000;
}
/**驾车敌人是否进入我放基地 */
private checkEnemiesInBase(entity: ecs.Entity) {
const view = entity.get(HeroViewComp);
if(view.fac==FacSet.MON){
if(view.atk_heart) return
if(view.node.position.x <= FightSet.HEARTPOS){
oops.message.dispatchEvent(GameEvent.LifeChange,-1)
view.atk_heart=true
}
}
}
/** 检测攻击范围内敌人 */
private checkEnemiesInRange(entity: ecs.Entity, range: number): boolean {
const currentPos = entity.get(HeroViewComp).node.position;

View File

@@ -83,7 +83,6 @@ export class BuffComp extends Component {
vmdata_update(is_hp:boolean=false){
// console.log("[BuffComp]:to_update_vmdata:"+this.HeroView.hero_name)
let info= null
if(!this.HeroView) return
if(!this.HeroView.is_master) return

View File

@@ -71,7 +71,13 @@ export class Hero extends ecs.Entity {
oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid})
const move = this.get(BattleMoveComp);
move.direction = 1; // 向右移动
move.targetX = 800; // 右边界'
move.targetX = 0; // 右边界'
if(HeroInfo[uuid].type==HType.remote){
move.targetX = -100; // 右边界'
}
if(HeroInfo[uuid].type==HType.mage){
move.targetX = -200; // 右边界'
}
}
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

@@ -24,6 +24,7 @@ const { ccclass, property } = _decorator;
@ecs.register('HeroView', false) // 定义为 ECS 组件
export class HeroViewComp extends CCComp {
BUFFCOMP:BuffComp=null!
atk_heart:boolean=false;
as: HeroSpine = null!
status:String = "idle"
hero_uuid:number = 1001;
@@ -166,7 +167,7 @@ export class HeroViewComp extends CCComp {
start () {
this.as.idle()
this.BUFFCOMP=this.node.getComponent(BuffComp);
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
/** 方向 */
this.node.setScale(this.scale,1);
this.node.getChildByName("top").setScale(this.scale,1);
@@ -177,7 +178,9 @@ export class HeroViewComp extends CCComp {
this.node.getChildByName("top").getChildByName("hp").active = true;
}
update_vmdata(){
if(this.is_master) this.BUFFCOMP.vmdata_update()
}
update(dt: number){
if(!smc.mission.play||smc.mission.pause) return
// if(this.is_dead) {
@@ -234,70 +237,70 @@ export class HeroViewComp extends CCComp {
change_wfuny(wfuny: number){
this.wfuny+=wfuny
if(this.wfuny<0) this.wfuny=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_puncture(puncture: number){
this.puncture+=puncture
if(this.puncture<1) this.puncture=1
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_puncture_damage(puncture_damage: number){
this.puncture_damage+=puncture_damage
if(this.puncture_damage<0) this.puncture_damage=0
if(this.puncture_damage>80) this.puncture_damage=80
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_dodge(dodge: number){
this.dod+=dodge
if(this.dod<0) this.dod=0
if(this.dod>90) this.dod=90
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_frost_ratto(frost_ratto: number){
this.frost_ratto+=frost_ratto
if(this.frost_ratto<0) this.frost_ratto=0
if(this.frost_ratto>90) this.frost_ratto=90
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_knockback(knockback: number){
this.knockback+=knockback
if(this.knockback<0) this.knockback=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_stun_ratto(stun_ratto: number){
this.stun_ratto+=stun_ratto
if(this.stun_ratto<0) this.stun_ratto=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_def(def: number){
this.def+=def
if(this.def>90) this.def=90
if(this.def<0) this.def=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
// this.BUFFCOMP.tooltip(TooltipTypes.defup,def.toFixed(0));
}
change_crit(crit: number){
this.crit+=crit
if(this.crit<0) this.crit=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_crit_d(crit_d: number){
this.crit_d+=crit_d
if(this.crit_d<0) this.crit_d=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_reflect(reflect: number){
this.reflect+=reflect
if(this.reflect<0) this.reflect=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
change_lifesteal(lifesteal: number){
this.lifesteal+=lifesteal
if(this.lifesteal<0) this.lifesteal=0
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
}
check_atrr(buff:BuffAttr){
@@ -316,19 +319,17 @@ export class HeroViewComp extends CCComp {
switch(buff){
case BuffAttr.ATK:
this.ap=this.check_atrr(BuffAttr.ATK)
// if(this.is_master) {
// // this.BUFFCOMP.vmdata_update();
// }
// this.update_vmdata()
break
case BuffAttr.ATK_CD:
this.cd=this.check_atrr(BuffAttr.ATK_CD)
// if(this.is_master) this.BUFFCOMP.vmdata_update()
// this.update_vmdata()
break
case BuffAttr.HP:
let diff=this.check_atrr(BuffAttr.HP)-this.hp_max
this.hp_max=this.check_atrr(BuffAttr.HP)
this.hp+=diff
// if(this.is_master) this.BUFFCOMP.vmdata_update(true)
// this.update_vmdata()
break
}
}
@@ -376,7 +377,7 @@ export class HeroViewComp extends CCComp {
//console.log("[HeroViewComp]:de_hp_max de:",hp,this.hp_max)
this.hp_base -= Math.floor(hp) ;
this.count_atrr(BuffAttr.HP)
// if(this.is_master) this.BUFFCOMP.vmdata_update(true)
// this.update_vm
}
add_hp(hp: number = 0,is_num:boolean=true) {
@@ -401,7 +402,7 @@ export class HeroViewComp extends CCComp {
this.hp+=real_hp;
this.BUFFCOMP.tooltip(TooltipTypes.health,real_hp.toFixed(0));
}
// if(this.is_master) this.BUFFCOMP.vmdata_update(true)
// this.update_vm
}
@@ -626,7 +627,7 @@ export class HeroViewComp extends CCComp {
this.ent.destroy();
}
}
// if(this.is_master) this.BUFFCOMP.vmdata_update(true)
// this.update_vm
this.showDamage(damage, is_crit);
}
@@ -781,12 +782,7 @@ export class HeroViewComp extends CCComp {
}
to_update(){
// console.log("[HeroViewComp]:to_update",this.is_master)
// if(!this.is_master) return
// smc.vmdata.hero.exp = smc.vmdata.hero.exp-smc.vmdata.hero.next_exp
// smc.vmdata.hero.lv = smc.vmdata.hero.lv+1
// smc.vmdata.hero.next_exp=getUpExp(smc.vmdata.hero.lv)
// oops.message.dispatchEvent(GameEvent.HeroLvUp,{lv:smc.vmdata.hero.lv})
if(this.fac==FacSet.MON) return
this.BUFFCOMP.lv_up()
// this.BUFFCOMP.tooltip(TooltipTypes.lvup)
}

View File

@@ -90,7 +90,7 @@ export class SkillConComp extends CCComp {
cast_master_skill(e:string,uuid:any){
if(!this.HeroView) return
if(!this.HeroView.is_master) return
if(this.HeroView.fac==FacSet.MON) return
//console.log("hart cast_skill",uuid ,e)
const config = SkillSet[uuid];
this.castSkill(config,false,this.HeroView.skill_dmg)
@@ -106,7 +106,7 @@ export class SkillConComp extends CCComp {
use_max_skill(e:GameEvent,data:any){
if(!this.HeroView) return
if(!this.HeroView.is_master) return
if(this.HeroView.fac==FacSet.MON) return
//console.log("[SkillConComp]:use_max_skill:",data)
this.skill_id_counter++;
this.aoe_queues.push({

View File

@@ -28,7 +28,6 @@ export class CardComp extends CCComp {
skill_slot:string="skill1"
equip_slot:string="weapon"
talent_slot:string="tal1"
is_master:boolean=false;
enhancement_data:any=null;
onLoad(){
// this.on(GameEvent.HeroSelect,this.hero_select,this)
@@ -54,11 +53,10 @@ export class CardComp extends CCComp {
this.node.getChildByName("Button").active=true
}, 0.1);
}
hero_select(args: any,is_master:boolean=false){
hero_select(args: any){
this.c_type=cardType.HERO
this.c_uuid=args.uuid
this.is_master=is_master
this.show_hero(this.c_uuid,is_master)
this.show_hero(this.c_uuid)
this.node.getChildByName("show").active=false
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
this.scheduleOnce(() => {
@@ -153,7 +151,7 @@ export class CardComp extends CCComp {
show.getChildByName("info").getComponent(Label).string=SkillSet[uuid].info
}
show_hero(uuid:number,is_master:boolean=false){
show_hero(uuid:number){
let show=this.node.getChildByName("show")
show.getChildByName("name").getChildByName("name").getComponent(Label).string=HeroInfo[uuid].name
this.do_card_bg_show(HeroInfo[uuid].quality)
@@ -304,7 +302,7 @@ export class CardComp extends CCComp {
use_card(){
switch(this.c_type){
case cardType.HERO:
oops.message.dispatchEvent(GameEvent.UseHeroCard,{uuid:this.c_uuid,is_master:this.is_master})
oops.message.dispatchEvent(GameEvent.UseHeroCard,{uuid:this.c_uuid})
oops.message.dispatchEvent(GameEvent.CardsClose)
break
case cardType.SKILL:

View File

@@ -72,8 +72,7 @@ export class CardsCompComp extends CCComp {
switch(e){
case GameEvent.HeroSelect:
console.log("[CardsComp]:显示英雄选择卡牌",data)
let title="选择伙伴"
if(data.is_master) title="选择英雄"
let title="选择英雄"
this.node.getChildByName("top").getChildByName("title").getChildByName("Label").getComponent(Label).string=title
this.hero_select(data)
break
@@ -126,16 +125,11 @@ export class CardsCompComp extends CCComp {
this.card3c.enhancement_select(list[2])
}
hero_select(data:any){
let list=[]
if(data.is_master){ //1是主将,0 是伙伴
list=getRandomCardsByType(cardType.HERO,3,1)
}else{
list=getRandomCardsByType(cardType.HERO,3,0)
}
let list=getRandomCardsByType(cardType.HERO,3,0)
console.log("[CardsComp]:英雄选择卡牌列表",list)
this.card1c.hero_select(list[0],data.is_master)
this.card2c.hero_select(list[1],data.is_master)
this.card3c.hero_select(list[2],data.is_master)
this.card1c.hero_select(list[0])
this.card2c.hero_select(list[1])
this.card3c.hero_select(list[2])
// this.card4c.hero_select(list[3])
}

View File

@@ -0,0 +1,39 @@
import { _decorator, Component, Node } from 'cc';
import { oops } from 'db://oops-framework/core/Oops';
import { GameEvent } from '../common/config/GameEvent';
const { ccclass, property } = _decorator;
@ccclass('LifeComp')
export class LifeComp extends Component {
loss_life:number=0
protected onLoad(): void {
oops.message.on(GameEvent.FightReady,this.onFightReady,this)
oops.message.on(GameEvent.LifeChange,this.onLifeChange,this)
}
start() {
this.node.setSiblingIndex(100)
}
update(deltaTime: number) {
}
onFightReady(args: any) {
console.log("[LifeComp]:onMissionStart",args)
let nodes=this.node.children
nodes[0].active=true
nodes[1].active=true
nodes[2].active=true
this.loss_life=0
}
onLifeChange(args: any) {
console.log("[LifeComp]:onLifeChange loss_life:",this.loss_life)
let nodes=this.node.children
nodes[this.loss_life].active=false
this.loss_life++
if(this.loss_life >= 3){
oops.message.dispatchEvent(GameEvent.MissionLoss)
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "3bb0f1a5-485d-4c26-a592-9553f8c00f37",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -156,13 +156,13 @@ export class MissionComp extends CCComp {
do_mon_dead(){
this.do_mon_dead_thing()
smc.vmdata.mission_data.mon_num--
if(smc.vmdata.mission_data.mon_num<=0 && this.count_tal() < FightSet.TAL_NUM) {
if(smc.vmdata.mission_data.current_wave == RogueTalWave[this.count_tal()].wave){
console.log("[MissionComp] current_wave:"+smc.vmdata.mission_data.current_wave+" tal wave:"+RogueTalWave[this.count_tal()].wave)
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:TalentSlot[this.count_tal()]})
this.tals[this.count_tal()]=true
if(smc.vmdata.mission_data.mon_num<=0) {
// if(smc.vmdata.mission_data.current_wave == RogueTalWave[this.count_tal()].wave){
// console.log("[MissionComp] current_wave:"+smc.vmdata.mission_data.current_wave+" tal wave:"+RogueTalWave[this.count_tal()].wave)
// oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:TalentSlot[this.count_tal()]})
// this.tals[this.count_tal()]=true
}
// }
this.show_time(this.do_next_wave.bind(this))
}
}
@@ -246,7 +246,7 @@ export class MissionComp extends CCComp {
}
to_ready(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:true})
oops.message.dispatchEvent(GameEvent.HeroSelect)
}
ready_to_fight(){
this.time_num=5
@@ -265,7 +265,7 @@ export class MissionComp extends CCComp {
// oops.message.dispatchEvent(GameEvent.EnhancementSelect)
// }
to_call_friend(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:false})
oops.message.dispatchEvent(GameEvent.HeroSelect)
}
to_fight(){
@@ -335,7 +335,7 @@ export class MissionComp extends CCComp {
}
call_friend_card(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:false})
oops.message.dispatchEvent(GameEvent.HeroSelect)
}
call_tal_card(){
oops.message.dispatchEvent(GameEvent.TalentSelect)

View File

@@ -43,7 +43,7 @@ export class MissionHeroCompComp extends CCComp {
}
private zhao_huan(event: string, args: any){
console.log("[MissionHeroComp]:zhaohuan",args)
this.addHero(args.uuid,false,true)
this.addHero(args.uuid,false)
}
@@ -57,19 +57,12 @@ export class MissionHeroCompComp extends CCComp {
// let x=RandomManager.instance.getRandomInt(0,hero_list.length,1)
// // let uuid=args.uuid
// // console.log("call_hero",uuid)
this.addHero(args.uuid,args.is_master,false)
this.addHero(args.uuid,false)
}
/** 添加英雄 */
private addHero(uuid:number=1001,is_master:boolean=false,is_zhaohuan:boolean=false) {
let hero_pos=1
if(is_master){
hero_pos=0
}
if(is_zhaohuan){
hero_pos=2
}
private addHero(uuid:number=1001,is_zhaohuan:boolean=false) {
let hero_pos=0
let hero = ecs.getEntity<Hero>(Hero);
let scale = 1
let pos:Vec3 = HeroPos[hero_pos].pos;