锻造升级

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-10 01:36:20 +08:00
parent 6fbb142edc
commit 0d745b9715
22 changed files with 5392 additions and 1230 deletions

View File

@@ -30,12 +30,12 @@ import { Component } from "cc";
// let APIPath = `http://localhost:8080`
// let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://192.168.1.23:8080`
// let WsPath = `ws://192.168.1.23:8080/websocket`
let APIPath = `http://192.168.1.23:8080`
let WsPath = `ws://192.168.1.23:8080/websocket`
// let APIPath = `http://192.168.0.119:8080`
// let WsPath = `ws://192.168.0.119:8080/websocket`
let APIPath = `https://api.pet.jisol.cn`
let WsPath = `wss://api.pet.jisol.cn/websocket`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`
//重写UI
class JNGLayer extends JNLayer{

View File

@@ -106,12 +106,7 @@ export default class GRoleDefault extends GRoleBase<{}>{
//设置血条位置
if(this.spine){
let runtimeData = this.spine.skeletonData.getRuntimeData();
let height = Math.abs(runtimeData.height);
let y = Math.abs(runtimeData.y);
let x = Math.abs(this.spine.node.scale.x);
let headY = (height + y + 20) * x;
this.headInfo.setPosition(v3(this.headInfo.position.x,headY,this.headInfo.position.z))
this.headInfo.setPosition(v3(this.headInfo.position.x,role.roleHight,this.headInfo.position.z))
}
}

View File

@@ -59,6 +59,8 @@ export class TbGRole {
{ this.roleSkillIds = []; for(let _ele of _json_.roleSkillIds) { let _e; _e = _ele; this.roleSkillIds.push(_e);}}
if (_json_.roleAttackRange === undefined) { throw new Error() }
this.roleAttackRange = _json_.roleAttackRange
if (_json_.roleHight === undefined) { throw new Error() }
this.roleHight = _json_.roleHight
}
/**
@@ -81,6 +83,10 @@ export class TbGRole {
* 角色攻击范围
*/
readonly roleAttackRange: number
/**
* 角色高度
*/
readonly roleHight: number
resolve(tables:Tables)
{
@@ -844,6 +850,10 @@ export class TbGRoleEquipQuality {
{ this.odds = []; for(let _ele of _json_.odds) { let _e; _e = _ele; this.odds.push(_e);}}
if (_json_.total === undefined) { throw new Error() }
this.total = _json_.total
if (_json_.materials === undefined) { throw new Error() }
{ this.materials = []; for(let _ele of _json_.materials) { let _e; _e = new TbGEntity.TResource(_ele); this.materials.push(_e);}}
if (_json_.upTime === undefined) { throw new Error() }
this.upTime = _json_.upTime
}
/**
@@ -858,6 +868,14 @@ export class TbGRoleEquipQuality {
* 总概率
*/
readonly total: number
/**
* 升级消耗的材料
*/
readonly materials: TbGEntity.TResource[]
/**
* 升级所需时间(s)
*/
readonly upTime: number
resolve(tables:Tables)
{

View File

@@ -2,9 +2,18 @@
export default class NumberTools {
//随机
public GetRank(min, max) {
public static GetRank(min, max) {
return Math.round(Math.random() * (max - min)) + min;
}
//显示文本数字
public static NumberStr(value:number){
if(Math.floor(value / 1000000))
return `${(value / 1000000).toFixed(1)}M`
if(Math.floor(value / 1000))
return `${(value / 1000).toFixed(1)}K`
return value;
}
}

View File

@@ -3,6 +3,7 @@ import { _decorator, Component, Node } from 'cc';
import ResourceData, { ResourceEvent, ResourceType } from '../../../data/ResourceData';
import { Enum } from 'cc';
import { app } from '../../../App';
import NumberTools from '../../../tools/NumberTools';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceShow')
@@ -34,7 +35,7 @@ export class PlayerResourceShow extends Component {
onUpdateView(){
//更新资源数量
this.show.string = `${ResourceData.getIns().getValue(this.type)}`;
this.show.string = `${NumberTools.NumberStr(ResourceData.getIns().getValue(this.type))}`;
}

View File

@@ -60,7 +60,7 @@ export class MainView extends JNGLayerBase {
//更新UI界面
onUpdateView(){
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerId}`;
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
this.onUpdateOnHookInfo();
this.onUpdateOnHook();
}