ui设计,卡牌规则修改,不需升级卡牌词,卡牌召唤兽不再有等级

This commit is contained in:
2024-09-04 17:03:44 +08:00
parent ad52a9ad9c
commit 44cb46e7de
11 changed files with 2111 additions and 2174 deletions

View File

@@ -76,17 +76,17 @@ export class Role extends ecs.Entity {
mv.speed =mv.ospeed = 0;
mv.hero_name= "role";
buff.group= mv.box_group= BoxSet.HERO;
mv.hp= mv.hp_max = 1000;
mv.hp= mv.hp_max = smc.vm_data.role.hp;
mv.level = 1;
mv.atk = 5;
mv.atk_cd = 0.5;
mv.power = 300;
mv.atk = smc.vm_data.role.atk;
mv.atk_cd = smc.vm_data.role.atk_cd;
mv.power = smc.vm_data.role.power;
mv.type = 1;
mv.skill_uuid = 9001;
mv.max_skill_uuid = 9001;
mv.Tpos = v3(0,0,0);
mv.scale = 1;
mv.atk_range=800;
mv.atk_range=1000;
// mv.change_name(smc.heros[uuid].name,1)
this.add(mv);
this.add(buff);

View File

@@ -63,12 +63,14 @@ export class SingletonModuleComp extends ecs.Comp {
g_level:1,
g_time:0,
},
player:{
hp_max:30,
role:{
hp:300,
atk:10,
lv:1,
exp:0,
next_exp:100,
power:300,
atk_cd:1.5,
},
/** 当前等级 */
cards:{
@@ -78,14 +80,6 @@ export class SingletonModuleComp extends ecs.Comp {
ref_cost:1,
up_cost:4,
},
hp: {
min:20,
max:30
},
power: {
min: 10,
max: 30
},
gold: {
min: 200,
max: 200,

View File

@@ -11,26 +11,25 @@ export const CardType = {
export const CardList={
1:[
{uuid:1101,type:1},{uuid:1102,type:1},{uuid:1201,type:1},{uuid:1202,type:1},{uuid:1301,type:1},{uuid:1302,type:1},
{uuid:1001,type:2},{uuid:1002,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},
],
2:[
{uuid:2101,type:1},{uuid:2102,type:1},{uuid:2201,type:1},{uuid:2202,type:1},{uuid:2301,type:1},{uuid:2302,type:1},
{uuid:1001,type:2},{uuid:1002,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},
],
3:[
{uuid:3101,type:1},{uuid:3102,type:1},{uuid:3201,type:1},{uuid:3202,type:1},{uuid:3301,type:1},{uuid:3302,type:1},
{uuid:1001,type:2},{uuid:1002,type:2},{uuid:4011,type:2},{uuid:4012,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},{uuid:6002,type:3},{uuid:6003,type:3},{uuid:6005,type:3},{uuid:6006,type:3},{uuid:6102,type:3},{uuid:6103,type:3},
{uuid:6210,type:3},{uuid:6213,type:3},{uuid:6216,type:3},
],
4:[
{uuid:4101,type:1},{uuid:4102,type:1},{uuid:4201,type:1},{uuid:4202,type:1},{uuid:4301,type:1},{uuid:4302,type:1},
{uuid:1001,type:2},{uuid:1002,type:2},{uuid:4011,type:2},{uuid:4012,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},{uuid:6002,type:3},{uuid:6003,type:3},{uuid:6005,type:3},{uuid:6006,type:3},{uuid:6102,type:3},{uuid:6103,type:3},
{uuid:6210,type:3},{uuid:6213,type:3},{uuid:6216,type:3},{uuid:6211,type:3},{uuid:6212,type:3},{uuid:6214,type:3},{uuid:6215,type:3},{uuid:6217,type:3},{uuid:6218,type:3},
],
2:[
{uuid:1001,type:2},{uuid:1002,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},
],
3:[
{uuid:1001,type:2},{uuid:1002,type:2},{uuid:4011,type:2},{uuid:4012,type:2},
{uuid:6001,type:3},{uuid:6004,type:3},{uuid:6101,type:3},{uuid:6002,type:3},{uuid:6003,type:3},{uuid:6005,type:3},{uuid:6006,type:3},{uuid:6102,type:3},{uuid:6103,type:3},
{uuid:6210,type:3},{uuid:6213,type:3},{uuid:6216,type:3},
],
4:[
{uuid:5001,type:1},{uuid:5002,type:1},{uuid:5003,type:1},{uuid:5004,type:1}
],
5:[{uuid:5001,type:1},{uuid:5002,type:1},{uuid:5003,type:1},{uuid:5004,type:1}],
// 1:[1101,1102,1103,1104,1105,1106,1201,1202,1203,1204,1205,1301,1302,1303,1304,],
// 2:[2101,2102,2103,2104,2105,2201,2202,2203,2204,2301,2302,2303,2304,2305,],

View File

@@ -111,11 +111,11 @@ export class MapMonsterComp extends CCComp {
switch (x) {
case 1:
monster_layer = scene.entityLayer1!.node!;
pos.y=pos.y+100;
pos.y=pos.y+80;
break;
case 2:
monster_layer= scene.entityLayer2!.node!;
pos.y=pos.y-100;
pos.y=pos.y-80;
break;
}

View File

@@ -45,9 +45,7 @@ export class Hero extends ecs.Entity {
var node = instantiate(prefab);
node.parent=layer
// let ratio=this.set_ratio(uuid);
// node.setScale(ratio*node.scale.x, ratio*node.scale.y, node.scale.z);
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y,0);
node.setPosition(pos)
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
const url = 'game/heros/heros';
@@ -59,26 +57,26 @@ export class Hero extends ecs.Entity {
this.hero_init(uuid,node)
oops.message.dispatchEvent("hero_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.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;
}
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
var mv = node.getComponent(MonsterViewComp)!;
var buff =node.getComponent(MonsterBuffComp)!;

View File

@@ -328,16 +328,22 @@ export class MonsterViewComp extends CCComp {
}
in_atked() {
this.sprite.setSharedMaterial(this.hitFlashMaterial, 0);
this.scheduleOnce(() => {
this.sprite.setSharedMaterial(this.orginalFlashMaterial, 0);
}, 0.1);
// var path = "game/skills/atked";
// var prefab: Prefab = oops.res.get(path, Prefab)!;
// var node = instantiate(prefab);
// let pos = v3(0,30)
// node.setPosition(pos)
// node.parent = this.node;
if(this.is_role){
var path = "game/skills/atked";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
let pos = v3(0,60)
node.setPosition(pos)
node.parent = this.node;
}else{
this.sprite.setSharedMaterial(this.hitFlashMaterial, 0);
this.scheduleOnce(() => {
this.sprite.setSharedMaterial(this.orginalFlashMaterial, 0);
}, 0.1);
}
}
dead(){
var path = "game/skills/dead";