mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 00:26:39 +00:00
Drafted new character as NPC.
This commit is contained in:
@@ -14,6 +14,7 @@ window.ATK_CHARACTER_STATE = {
|
||||
GetUp1: [10, "GetUp1"],
|
||||
Atk2: [11, "Atk2"],
|
||||
Atk3: [12, "Atk3"],
|
||||
Atk4: [13, "Atk4"],
|
||||
};
|
||||
|
||||
window.ATK_CHARACTER_STATE_ARR = [];
|
||||
|
@@ -129,7 +129,7 @@ cc.Class({
|
||||
inAir: true,
|
||||
}),
|
||||
],
|
||||
speciesIdList: [1, 0],
|
||||
speciesIdList: [4196, 0],
|
||||
});
|
||||
|
||||
self.selfPlayerInfo = {
|
||||
|
@@ -110,6 +110,8 @@ TileCollisionManager.prototype.extractBoundaryObjects = function(withTiledMapNod
|
||||
let toRet = {
|
||||
playerStartingPositions: [],
|
||||
barriers: [],
|
||||
npcStartingPositions: [],
|
||||
npcPatrolCues: [],
|
||||
};
|
||||
const tiledMapIns = withTiledMapNode.getComponent(cc.TiledMap); // This is a magic name.
|
||||
|
||||
@@ -128,6 +130,38 @@ TileCollisionManager.prototype.extractBoundaryObjects = function(withTiledMapNod
|
||||
toRet.playerStartingPositions.push(wpos);
|
||||
}
|
||||
break;
|
||||
case "NpcPatrolCue":
|
||||
for (let j = 0; j < allObjects.length; ++j) {
|
||||
const cccMaskedX = allObjects[j].x,
|
||||
cccMaskedY = allObjects[j].y;
|
||||
const origX = cccMaskedX,
|
||||
origY = withTiledMapNode.getContentSize().height - cccMaskedY;
|
||||
let wpos = this.continuousObjLayerOffsetToContinuousMapNodePos(withTiledMapNode, cc.v2(origX, origY));
|
||||
const cue = {
|
||||
x: wpos.x,
|
||||
y: wpos.y,
|
||||
flAct: parseInt(allObjects[j].flAct),
|
||||
frAct: parseInt(allObjects[j].frAct),
|
||||
};
|
||||
toRet.npcPatrolCues.push(cue);
|
||||
}
|
||||
break;
|
||||
case "NpcStartingPos":
|
||||
for (let j = 0; j < allObjects.length; ++j) {
|
||||
const cccMaskedX = allObjects[j].x,
|
||||
cccMaskedY = allObjects[j].y;
|
||||
const origX = cccMaskedX,
|
||||
origY = withTiledMapNode.getContentSize().height - cccMaskedY;
|
||||
let wpos = this.continuousObjLayerOffsetToContinuousMapNodePos(withTiledMapNode, cc.v2(origX, origY));
|
||||
const npc = {
|
||||
x: wpos.x,
|
||||
y: wpos.y,
|
||||
speciesId: parseInt(allObjects[j].speciesId),
|
||||
dirX: parseInt(allObjects[j].dirX),
|
||||
};
|
||||
toRet.npcStartingPositions.push(npc);
|
||||
}
|
||||
break;
|
||||
case "Barrier":
|
||||
for (let j = 0; j < allObjects.length; ++j) {
|
||||
let object = allObjects[j];
|
||||
@@ -205,30 +239,6 @@ TileCollisionManager.prototype.initMapNodeByTiledBoundaries = function(mapScript
|
||||
mapScriptIns.barrierColliders.push(newBarrierColliderIns);
|
||||
mapScriptIns.node.addChild(newBarrier);
|
||||
}
|
||||
|
||||
const allLayers = tiledMapIns.getLayers();
|
||||
for (let layer of allLayers) {
|
||||
const layerType = layer.getProperty("type");
|
||||
switch (layerType) {
|
||||
case "barrier_and_shelter":
|
||||
setLocalZOrder(layer.node, 3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const allObjectGroups = tiledMapIns.getObjectGroups();
|
||||
for (let objectGroup of allObjectGroups) {
|
||||
const objectGroupType = objectGroup.getProperty("type");
|
||||
switch (objectGroupType) {
|
||||
case "barrier_and_shelter":
|
||||
setLocalZOrder(objectGroup.node, 3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.tileCollisionManager = new TileCollisionManager();
|
||||
|
@@ -1214,6 +1214,8 @@ $root.protos = (function() {
|
||||
* @property {number|null} [activeSkillId] PlayerDownsync activeSkillId
|
||||
* @property {number|null} [activeSkillHit] PlayerDownsync activeSkillHit
|
||||
* @property {number|null} [framesInvinsible] PlayerDownsync framesInvinsible
|
||||
* @property {number|null} [bulletTeamId] PlayerDownsync bulletTeamId
|
||||
* @property {number|null} [chCollisionTeamId] PlayerDownsync chCollisionTeamId
|
||||
* @property {string|null} [name] PlayerDownsync name
|
||||
* @property {string|null} [displayName] PlayerDownsync displayName
|
||||
* @property {string|null} [avatar] PlayerDownsync avatar
|
||||
@@ -1418,6 +1420,22 @@ $root.protos = (function() {
|
||||
*/
|
||||
PlayerDownsync.prototype.framesInvinsible = 0;
|
||||
|
||||
/**
|
||||
* PlayerDownsync bulletTeamId.
|
||||
* @member {number} bulletTeamId
|
||||
* @memberof protos.PlayerDownsync
|
||||
* @instance
|
||||
*/
|
||||
PlayerDownsync.prototype.bulletTeamId = 0;
|
||||
|
||||
/**
|
||||
* PlayerDownsync chCollisionTeamId.
|
||||
* @member {number} chCollisionTeamId
|
||||
* @memberof protos.PlayerDownsync
|
||||
* @instance
|
||||
*/
|
||||
PlayerDownsync.prototype.chCollisionTeamId = 0;
|
||||
|
||||
/**
|
||||
* PlayerDownsync name.
|
||||
* @member {string} name
|
||||
@@ -1512,6 +1530,10 @@ $root.protos = (function() {
|
||||
writer.uint32(/* id 22, wireType 0 =*/176).int32(message.activeSkillHit);
|
||||
if (message.framesInvinsible != null && Object.hasOwnProperty.call(message, "framesInvinsible"))
|
||||
writer.uint32(/* id 23, wireType 0 =*/184).int32(message.framesInvinsible);
|
||||
if (message.bulletTeamId != null && Object.hasOwnProperty.call(message, "bulletTeamId"))
|
||||
writer.uint32(/* id 24, wireType 0 =*/192).int32(message.bulletTeamId);
|
||||
if (message.chCollisionTeamId != null && Object.hasOwnProperty.call(message, "chCollisionTeamId"))
|
||||
writer.uint32(/* id 25, wireType 0 =*/200).int32(message.chCollisionTeamId);
|
||||
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
||||
writer.uint32(/* id 997, wireType 2 =*/7978).string(message.name);
|
||||
if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName"))
|
||||
@@ -1644,6 +1666,14 @@ $root.protos = (function() {
|
||||
message.framesInvinsible = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
message.bulletTeamId = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 25: {
|
||||
message.chCollisionTeamId = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 997: {
|
||||
message.name = reader.string();
|
||||
break;
|
||||
@@ -1760,6 +1790,12 @@ $root.protos = (function() {
|
||||
if (message.framesInvinsible != null && message.hasOwnProperty("framesInvinsible"))
|
||||
if (!$util.isInteger(message.framesInvinsible))
|
||||
return "framesInvinsible: integer expected";
|
||||
if (message.bulletTeamId != null && message.hasOwnProperty("bulletTeamId"))
|
||||
if (!$util.isInteger(message.bulletTeamId))
|
||||
return "bulletTeamId: integer expected";
|
||||
if (message.chCollisionTeamId != null && message.hasOwnProperty("chCollisionTeamId"))
|
||||
if (!$util.isInteger(message.chCollisionTeamId))
|
||||
return "chCollisionTeamId: integer expected";
|
||||
if (message.name != null && message.hasOwnProperty("name"))
|
||||
if (!$util.isString(message.name))
|
||||
return "name: string expected";
|
||||
@@ -1830,6 +1866,10 @@ $root.protos = (function() {
|
||||
message.activeSkillHit = object.activeSkillHit | 0;
|
||||
if (object.framesInvinsible != null)
|
||||
message.framesInvinsible = object.framesInvinsible | 0;
|
||||
if (object.bulletTeamId != null)
|
||||
message.bulletTeamId = object.bulletTeamId | 0;
|
||||
if (object.chCollisionTeamId != null)
|
||||
message.chCollisionTeamId = object.chCollisionTeamId | 0;
|
||||
if (object.name != null)
|
||||
message.name = String(object.name);
|
||||
if (object.displayName != null)
|
||||
@@ -1876,6 +1916,8 @@ $root.protos = (function() {
|
||||
object.activeSkillId = 0;
|
||||
object.activeSkillHit = 0;
|
||||
object.framesInvinsible = 0;
|
||||
object.bulletTeamId = 0;
|
||||
object.chCollisionTeamId = 0;
|
||||
object.name = "";
|
||||
object.displayName = "";
|
||||
object.avatar = "";
|
||||
@@ -1926,6 +1968,10 @@ $root.protos = (function() {
|
||||
object.activeSkillHit = message.activeSkillHit;
|
||||
if (message.framesInvinsible != null && message.hasOwnProperty("framesInvinsible"))
|
||||
object.framesInvinsible = message.framesInvinsible;
|
||||
if (message.bulletTeamId != null && message.hasOwnProperty("bulletTeamId"))
|
||||
object.bulletTeamId = message.bulletTeamId;
|
||||
if (message.chCollisionTeamId != null && message.hasOwnProperty("chCollisionTeamId"))
|
||||
object.chCollisionTeamId = message.chCollisionTeamId;
|
||||
if (message.name != null && message.hasOwnProperty("name"))
|
||||
object.name = message.name;
|
||||
if (message.displayName != null && message.hasOwnProperty("displayName"))
|
||||
|
Reference in New Issue
Block a user