This commit is contained in:
walkpan
2024-09-09 07:56:18 +08:00
parent 47af795c12
commit 9bac2d5c5b
264 changed files with 96262 additions and 53551 deletions

View File

@@ -14,7 +14,6 @@ import { smc } from "../common/SingletonModuleComp";
import { MonsterModelComp } from "./MonsterModelComp";
import { MonsterSpine } from "./MonsterSpine";
import { MonsterViewComp } from "./MonsterViewComp";
import { CardSet } from "../common/config/CardSet";
import { BoxSet } from "../common/config/BoxSet";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { MonsterBuffComp } from "./MonsterBuffComp";
@@ -46,8 +45,8 @@ export class Monster extends ecs.Entity {
var node = instantiate(prefab);
node.parent=layer
// var as = node.getComponent(MonsterSpine);
// let ratio=this.set_ratio(uuid);
node.setScale(node.scale.x*scale, node.scale.y, node.scale.z);
let ratio=this.set_ratio(uuid);
node.setScale(node.scale.x*scale*ratio, node.scale.y*ratio, 0);
// node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
@@ -60,29 +59,30 @@ export class Monster extends ecs.Entity {
this.hero_init(uuid,node)
oops.message.dispatchEvent("monster_load",this)
}
// set_ratio(uuid:number){
// let ratio=1;
// switch (smc.heros[uuid].level) {
// case 2:
// ratio=1.1
// break;
// case 3:
// ratio=1.2
// break;
// case 4:
// ratio=1.3
// break;
// case 5:
// ratio=1.4
// break;
// default:
// ratio=1
// }
// return ratio;
// }
set_ratio(uuid:number){
let ratio=1;
switch (smc.heros[uuid].level) {
case 2:
ratio=1.05
break;
case 3:
ratio=1.1
break;
case 4:
ratio=1.15
break;
case 5:
ratio=1.2
break;
default:
ratio=1
}
return ratio;
}
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
var mv = node.getComponent(MonsterViewComp)!;
var buff =node.getComponent(MonsterBuffComp)!;
// console.log("hero_init",smc.heros,uuid)
mv.speed =mv.ospeed = smc.heros[uuid].speed;
mv.hero_name= smc.heros[uuid].name;
buff.group=mv.box_group= BoxSet.MONSTER;