mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 23:19:06 +00:00
sskn node handlers, tweaked some lain code
This commit is contained in:
parent
1ff702568f
commit
a4b42ebee2
5 changed files with 41 additions and 46 deletions
|
@ -121,7 +121,7 @@ const Lain = () => {
|
||||||
move_right: <LainMoveRight />,
|
move_right: <LainMoveRight />,
|
||||||
move_up: <LainMoveUp />,
|
move_up: <LainMoveUp />,
|
||||||
move_down: <LainMoveDown />,
|
move_down: <LainMoveDown />,
|
||||||
throwNode: <LainThrowNode />,
|
throw_node: <LainThrowNode />,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -7,40 +7,25 @@ const LainManager = (props: StateManagerProps) => {
|
||||||
|
|
||||||
const dispatchObject = useCallback(
|
const dispatchObject = useCallback(
|
||||||
(event: string) => {
|
(event: string) => {
|
||||||
const dispatcherObjects = {
|
switch (event) {
|
||||||
move_up: {
|
case "move_up":
|
||||||
action: setLainMoveState,
|
case "move_down":
|
||||||
value: "move_up",
|
case "move_left":
|
||||||
duration: 3904.704,
|
case "move_right":
|
||||||
},
|
return {
|
||||||
move_down: {
|
action: setLainMoveState,
|
||||||
action: setLainMoveState,
|
value: event,
|
||||||
value: "move_down",
|
duration: 3900,
|
||||||
duration: 3904.704,
|
};
|
||||||
},
|
case "throw_node_media":
|
||||||
move_left: {
|
case "throw_node_gate":
|
||||||
action: setLainMoveState,
|
case "throw_node_sskn":
|
||||||
value: "move_left",
|
return {
|
||||||
duration: 3904.704,
|
action: setLainMoveState,
|
||||||
},
|
value: "throw_node",
|
||||||
move_right: {
|
duration: 3904.704,
|
||||||
action: setLainMoveState,
|
};
|
||||||
value: "move_right",
|
}
|
||||||
duration: 3904.704,
|
|
||||||
},
|
|
||||||
throw_node_media: {
|
|
||||||
action: setLainMoveState,
|
|
||||||
value: "throwNode",
|
|
||||||
duration: 3904.704,
|
|
||||||
},
|
|
||||||
throw_node_gate: {
|
|
||||||
action: setLainMoveState,
|
|
||||||
value: "throwNode",
|
|
||||||
duration: 3904.704,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return dispatcherObjects[event as keyof typeof dispatcherObjects];
|
|
||||||
},
|
},
|
||||||
[setLainMoveState]
|
[setLainMoveState]
|
||||||
);
|
);
|
||||||
|
|
|
@ -96,6 +96,7 @@ const NodeManager = (props: StateManagerProps) => {
|
||||||
};
|
};
|
||||||
case "throw_node_media":
|
case "throw_node_media":
|
||||||
case "throw_node_gate":
|
case "throw_node_gate":
|
||||||
|
case "throw_node_sskn":
|
||||||
return {
|
return {
|
||||||
action: animateActiveNodeThrow,
|
action: animateActiveNodeThrow,
|
||||||
value: [0, true],
|
value: [0, true],
|
||||||
|
|
|
@ -10,6 +10,7 @@ const SceneManager = (props: StateManagerProps) => {
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case "throw_node_media":
|
case "throw_node_media":
|
||||||
case "throw_node_gate":
|
case "throw_node_gate":
|
||||||
|
case "throw_node_sskn":
|
||||||
return {
|
return {
|
||||||
action: setScene,
|
action: setScene,
|
||||||
value: newScene,
|
value: newScene,
|
||||||
|
@ -17,11 +18,18 @@ const SceneManager = (props: StateManagerProps) => {
|
||||||
};
|
};
|
||||||
case "exit_select":
|
case "exit_select":
|
||||||
case "exit_gate":
|
case "exit_gate":
|
||||||
|
case "sskn_cancel_select":
|
||||||
return {
|
return {
|
||||||
action: setScene,
|
action: setScene,
|
||||||
value: "main",
|
value: "main",
|
||||||
delay: 0,
|
delay: 0,
|
||||||
};
|
};
|
||||||
|
case "sskn_ok_select":
|
||||||
|
return {
|
||||||
|
action: setScene,
|
||||||
|
value: "main",
|
||||||
|
delay: 6000,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[setScene]
|
[setScene]
|
||||||
|
|
|
@ -92,12 +92,11 @@ const handleMainSceneEvent = (gameContext: GameContext) => {
|
||||||
// new active blue orb here.
|
// new active blue orb here.
|
||||||
const newActiveNodeId =
|
const newActiveNodeId =
|
||||||
newLevel +
|
newLevel +
|
||||||
node_matrices[
|
node_matrices[newSiteRotIdx as keyof typeof node_matrices][
|
||||||
newSiteRotIdx as keyof typeof node_matrices
|
newNodeRowIdx as number
|
||||||
][newNodeRowIdx as number][newNodeColIdx as number];
|
][newNodeColIdx as number];
|
||||||
|
|
||||||
const nodeType = (site_a as any)[newLevel][newActiveNodeId]
|
const nodeType = (site_a as any)[newLevel][newActiveNodeId].type;
|
||||||
.type;
|
|
||||||
|
|
||||||
const eventAnimation = "throw_node_";
|
const eventAnimation = "throw_node_";
|
||||||
|
|
||||||
|
@ -111,19 +110,21 @@ const handleMainSceneEvent = (gameContext: GameContext) => {
|
||||||
event = eventAnimation + "gate";
|
event = eventAnimation + "gate";
|
||||||
newScene = "gate";
|
newScene = "gate";
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
event = eventAnimation + "sskn";
|
||||||
|
newScene = "sskn";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const newActiveNodeId =
|
const newActiveNodeId =
|
||||||
newLevel +
|
newLevel +
|
||||||
node_matrices[
|
node_matrices[newSiteRotIdx as keyof typeof node_matrices][
|
||||||
newSiteRotIdx as keyof typeof node_matrices
|
newNodeRowIdx as number
|
||||||
][newNodeRowIdx as number][newNodeColIdx as number];
|
][newNodeColIdx as number];
|
||||||
|
|
||||||
const newActiveHudId =
|
const newActiveHudId =
|
||||||
hudAssocs[
|
hudAssocs[`${newNodeRowIdx}${newNodeColIdx}` as keyof typeof hudAssocs];
|
||||||
`${newNodeRowIdx}${newNodeColIdx}` as keyof typeof hudAssocs
|
|
||||||
];
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
event: event,
|
event: event,
|
||||||
|
|
Loading…
Reference in a new issue