Skip to content

Commit

Permalink
Update PortalType.cs - New portal types from current version of Maple…
Browse files Browse the repository at this point in the history
…Story: CollisionCustomImpact2, UNKNOWN_PCC, UNKNOWN_PCIR
  • Loading branch information
lastbattle committed Dec 25, 2024
1 parent 26902f9 commit ce98a56
Showing 1 changed file with 47 additions and 6 deletions.
53 changes: 47 additions & 6 deletions MapleLib/WzLib/WzStructure/Data/PortalType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum PortalType

/// <summary>Visible portal</summary>
Visible,
Default,

/// <summary>Collision portal</summary>
Collision,
Expand Down Expand Up @@ -48,11 +49,19 @@ public enum PortalType
/// <summary>Collision custom impact portal</summary>
CollisionCustomImpact,

/// <summary>Collision custom impact 2 portal</summary>
CollisionCustomImpact2,

/// <summary>Unknown collision portal type PCIG</summary>
CollisionUnknownPcig,

/// <summary>Hidden script portal UNG type</summary>
ScriptHiddenUng
ScriptHiddenUng,

/// <summary>Unknown for now, pcc (green square?) using 'pc' image</summary>
UNKNOWN_PCC,
/// <summary>Unknown for now, pcir. (red z?)</summary>
UNKNOWN_PCIR
}

// Extension method to convert enum values to original string codes
Expand All @@ -63,6 +72,7 @@ public static class PortalTypeExtensions
{ PortalType.StartPoint, "sp" },
{ PortalType.Invisible, "pi" },
{ PortalType.Visible, "pv" },
{ PortalType.Default, "default" }, // same as pv
{ PortalType.Collision, "pc" },
{ PortalType.Changeable, "pg" },
{ PortalType.ChangeableInvisible, "pgi" },
Expand All @@ -74,8 +84,12 @@ public static class PortalTypeExtensions
{ PortalType.ScriptHidden, "psh" },
{ PortalType.CollisionVerticalJump, "pcj" },
{ PortalType.CollisionCustomImpact, "pci" },
{ PortalType.CollisionCustomImpact2, "pci2" },
{ PortalType.CollisionUnknownPcig, "pcig" },
{ PortalType.ScriptHiddenUng, "pshg" }
{ PortalType.ScriptHiddenUng, "pshg" },

{ PortalType.UNKNOWN_PCC, "pcc" }, // unknown for now
{ PortalType.UNKNOWN_PCIR, "pcir" }, // unknown for now
};

private static readonly IReadOnlyDictionary<string, PortalType> _codeToPortalTypes =
Expand Down Expand Up @@ -104,6 +118,7 @@ public static PortalType FromCode(string code)
{ PortalType.StartPoint, "Start Point" },
{ PortalType.Invisible, "Invisible" },
{ PortalType.Visible, "Visible" },
{ PortalType.Default, "Visible (Default)" },
{ PortalType.Collision, "Collision" },
{ PortalType.Changeable, "Changable" },
{ PortalType.ChangeableInvisible, "Changable Invisible" },
Expand All @@ -113,10 +128,14 @@ public static PortalType FromCode(string code)
{ PortalType.CollisionScript, "Script Collision" },
{ PortalType.Hidden, "Hidden" },
{ PortalType.ScriptHidden, "Script Hidden" },
{ PortalType.CollisionVerticalJump, "Vertical Spring" },
{ PortalType.CollisionCustomImpact, "Custom Impact Spring" },
{ PortalType.CollisionVerticalJump, "Collision Vertical Jump" },
{ PortalType.CollisionCustomImpact, "Collision Custom Impact Spring" },
{ PortalType.CollisionCustomImpact2, "Collision Custom Impact Spring 2" },
{ PortalType.CollisionUnknownPcig, "Unknown (PCIG)" },
{ PortalType.ScriptHiddenUng, "Script Hidden Ung" } // Added this one since it was in the enum
{ PortalType.ScriptHiddenUng, "Script Hidden Ung" }, // Added this one since it was in the enum

{ PortalType.UNKNOWN_PCC, "Unknown pcc" },
{ PortalType.UNKNOWN_PCIR, "Unknown pcir" },
};

public static string GetFriendlyName(this PortalType portalType)
Expand All @@ -126,4 +145,26 @@ public static string GetFriendlyName(this PortalType portalType)
: throw new ArgumentOutOfRangeException(nameof(portalType));
}
}
}
}

/* 660 */
/*enum $6A2D6ECC51E909C6B55B51DC9641E1F1
{
PORTALTYPE_NONE = 0xFFFFFFFF,
PORTALTYPE_STARTPOINT = 0x0,
PORTALTYPE_INVISIBLE = 0x1,
PORTALTYPE_VISIBLE = 0x2,
PORTALTYPE_COLLISION = 0x3,
PORTALTYPE_CHANGABLE = 0x4,
PORTALTYPE_CHANGABLE_INVISIBLE = 0x5,
PORTALTYPE_TOWNPORTAL_POINT = 0x6,
PORTALTYPE_SCRIPT = 0x7,
PORTALTYPE_SCRIPT_INVISIBLE = 0x8,
PORTALTYPE_COLLISION_SCRIPT = 0x9,
PORTALTYPE_HIDDEN = 0xA,
PORTALTYPE_SCRIPT_HIDDEN = 0xB,
PORTALTYPE_COLLISION_VERTICAL_JUMP = 0xC,
PORTALTYPE_COLLISION_CUSTOM_IMPACT = 0xD,
PORTALTYPE_SCRIPT_INVISIBLE_CHANGEABLE = 0xE,
PORTALTYPE_COLLISION_CUSTOM_IMPACT2 = 0xF,
}*/

0 comments on commit ce98a56

Please sign in to comment.