generated from Jaysyn/ModuleTemplate
25 lines
694 B
Plaintext
25 lines
694 B
Plaintext
void main()
|
|
{
|
|
object oUser = GetLastUsedBy();
|
|
// Handle opening/closing
|
|
if (GetIsOpen(OBJECT_SELF))
|
|
{
|
|
ActionPlayAnimation(ANIMATION_PLACEABLE_CLOSE);
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
// play animation of user opening it
|
|
AssignCommand(oUser, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID));
|
|
DelayCommand(1.0, ActionPlayAnimation(ANIMATION_PLACEABLE_OPEN));
|
|
object oDoorWaypoint = GetWaypointByTag("oDoorWaypoint");
|
|
AssignCommand(oUser,ClearAllActions());
|
|
DelayCommand(1.9,AssignCommand(oUser,JumpToObject(oDoorWaypoint)));
|
|
DelayCommand(5.0,ActionPlayAnimation(ANIMATION_PLACEABLE_CLOSE));
|
|
return;
|
|
|
|
}
|
|
}
|
|
|
|
|