技能修改
This commit is contained in:
9
assets/resources/config/TS.meta
Normal file
9
assets/resources/config/TS.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.2.0",
|
||||||
|
"importer": "directory",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "f6a556e5-ddfa-414b-bb82-ea1da78872f3",
|
||||||
|
"files": [],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
409
assets/resources/config/TS/herosList.ts
Normal file
409
assets/resources/config/TS/herosList.ts
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
import { resources } from "cc";
|
||||||
|
|
||||||
|
class herosList {
|
||||||
|
/**
|
||||||
|
* 静态对象
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
* @static
|
||||||
|
* @type {herosList}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
private static instance: herosList;
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
* @type {Array<IherosInfo>}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public list: Array<IherosInfo> = [];
|
||||||
|
/**
|
||||||
|
* 配置单例
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @returns {herosList}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public static getInstance(): herosList {
|
||||||
|
if (!herosList.instance) {
|
||||||
|
herosList.instance = new herosList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return herosList.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载文件
|
||||||
|
*
|
||||||
|
* @return {*} {Promise<void>}
|
||||||
|
* @memberof LanguageList
|
||||||
|
*/
|
||||||
|
public async loadConfig(): Promise<void> {
|
||||||
|
const data: any = await new Promise((resolve: any, reject: any): any => {
|
||||||
|
resources.load('config\game/heros', (error: any, texture: any): any => {
|
||||||
|
if (error) {
|
||||||
|
console.log('loadRes error', 'config\game/heros', JSON.stringify(error));
|
||||||
|
resolve(null);
|
||||||
|
} else {
|
||||||
|
resolve(texture);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
herosList.instance.list = data.json.list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*
|
||||||
|
* @memberof TableBigWheelConfigList
|
||||||
|
*/
|
||||||
|
public async init(): Promise<void> {
|
||||||
|
if(herosList.instance.list.length === 0) {
|
||||||
|
await this.loadConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public uuid(index: number): number {
|
||||||
|
return this.list[index].uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public path(index: number): number {
|
||||||
|
return this.list[index].path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public type(index: number): number {
|
||||||
|
return this.list[index].type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public level(index: number): number {
|
||||||
|
return this.list[index].level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public name(index: number): string {
|
||||||
|
return this.list[index].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public atk(index: number): number {
|
||||||
|
return this.list[index].atk;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public hp(index: number): number {
|
||||||
|
return this.list[index].hp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public atk_cd(index: number): number {
|
||||||
|
return this.list[index].atk_cd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public power(index: number): number {
|
||||||
|
return this.list[index].power;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public speed(index: number): number {
|
||||||
|
return this.list[index].speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public skill(index: number): string {
|
||||||
|
return this.list[index].skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public max_skill(index: number): string {
|
||||||
|
return this.list[index].max_skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public skill_uuid(index: number): number {
|
||||||
|
return this.list[index].skill_uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public max_skill_uuid(index: number): number {
|
||||||
|
return this.list[index].max_skill_uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public word(index: number): string {
|
||||||
|
return this.list[index].word;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public info(index: number): string {
|
||||||
|
return this.list[index].info;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public atktype(index: number): string {
|
||||||
|
return this.list[index].atktype;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @param {number} index
|
||||||
|
* @return {*} {string}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public mon(index: number): string {
|
||||||
|
return this.list[index].mon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据长度
|
||||||
|
*
|
||||||
|
* @return {*} {number}
|
||||||
|
* @memberof herosList
|
||||||
|
*/
|
||||||
|
public dataLength(): number {
|
||||||
|
return this.list.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default herosList.getInstance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface IherosInfo {
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
uuid: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
path: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
type: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
level: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
name: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
atk: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
hp: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
atk_cd: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
power: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
speed: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
skill: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
max_skill: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
skill_uuid: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
max_skill_uuid: number
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
word: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
info: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
atktype: string
|
||||||
|
/**
|
||||||
|
* undefined
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof IherosInfo
|
||||||
|
*/
|
||||||
|
mon: string
|
||||||
|
|
||||||
|
}
|
||||||
9
assets/resources/config/TS/herosList.ts.meta
Normal file
9
assets/resources/config/TS/herosList.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "4.0.23",
|
||||||
|
"importer": "typescript",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "0474f376-56be-49e1-8350-420ba7eae103",
|
||||||
|
"files": [],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
1
assets/resources/config/game/skills.json
Normal file
1
assets/resources/config/game/skills.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"list":[]}
|
||||||
11
assets/resources/config/game/skills.json.meta
Normal file
11
assets/resources/config/game/skills.json.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"ver": "2.0.1",
|
||||||
|
"importer": "json",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "26f73f18-c4b1-45cf-93f0-78c21b53e707",
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
@@ -1940,7 +1940,7 @@
|
|||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 1,
|
"_group": 1,
|
||||||
"_density": 1,
|
"_density": 1,
|
||||||
"_sensor": true,
|
"_sensor": false,
|
||||||
"_friction": 0.2,
|
"_friction": 0.2,
|
||||||
"_restitution": 0,
|
"_restitution": 0,
|
||||||
"_offset": {
|
"_offset": {
|
||||||
|
|||||||
@@ -361,7 +361,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 10.164,
|
"x": 10.164,
|
||||||
"y": -17.963,
|
"y": -20,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
|
|||||||
@@ -34,10 +34,9 @@ export class Role extends ecs.Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 加载角色 */
|
/** 加载角色 */
|
||||||
load(uuid:number=101) {
|
load(pos: Vec3 = Vec3.ZERO,uuid:number=101) {
|
||||||
// var path = "game/monster/"+prefab_path;
|
// var path = "game/monster/"+prefab_path;
|
||||||
var path = "game/heros/role";
|
var path = "game/heros/role";
|
||||||
let pos: Vec3 = Vec3.ZERO
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
var node = instantiate(prefab);
|
var node = instantiate(prefab);
|
||||||
var scene = smc.map.MapView.scene;
|
var scene = smc.map.MapView.scene;
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ export class MapViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
load_role(){
|
load_role(){
|
||||||
let role = ecs.getEntity<Role>(Role);
|
let role = ecs.getEntity<Role>(Role);
|
||||||
role.load(103)
|
let pos = v3(0,BoxSet.GAME_LINE)
|
||||||
|
role.load(pos,108)
|
||||||
}
|
}
|
||||||
load_data(){
|
load_data(){
|
||||||
// let heros = oops.res.get("config/game/heros")
|
// let heros = oops.res.get("config/game/heros")
|
||||||
|
|||||||
@@ -31,26 +31,35 @@ export class BoxRangComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||||
if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){
|
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
|
||||||
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
|
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
|
||||||
this.MonsterViewComp.is_atking = true;
|
this.MonsterViewComp.is_atking = true;
|
||||||
|
if(Math.abs(otherCollider.node.position.x-selfCollider.node.position.x) < 120){
|
||||||
|
this.MonsterViewComp.stop_cd = 0.1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||||
if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){
|
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0 ){
|
||||||
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
|
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
|
||||||
this.MonsterViewComp.is_atking = false;
|
this.MonsterViewComp.is_atking = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||||
|
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
|
||||||
|
console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
|
||||||
|
this.MonsterViewComp.is_atking = true;
|
||||||
|
if(Math.abs(otherCollider.node.position.x-selfCollider.node.position.x) < 120){
|
||||||
|
this.MonsterViewComp.stop_cd = 0.1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
}
|
||||||
// onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
// }
|
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
reset() {
|
reset() {
|
||||||
this.node.destroy();
|
this.node.destroy();
|
||||||
|
|||||||
BIN
excel/heros.xlsx
BIN
excel/heros.xlsx
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user