Skip to content

Refactor runes for fast travel#1191

Open
Centorios wants to merge 11 commits intomasterfrom
refactor_RunesForFastTravel
Open

Refactor runes for fast travel#1191
Centorios wants to merge 11 commits intomasterfrom
refactor_RunesForFastTravel

Conversation

@Centorios
Copy link
Collaborator

-Deleted old iao code
-Created a new type of consumable rune to fast travel between cities
-refactor and tidy up a lot of code

Centorios and others added 11 commits February 8, 2026 18:55
Refactor rune handling and add support for a FastTravel rune plus per-item cooldowns.

- Codigo/Acciones.bas: Reworked CompletarAccionFin to use a With UserList(UserIndex) block, consolidated action cleanup, and added handling for MesonSafePassage and new FastTravel rune types. Replaced hardcoded message IDs with named constants and simplified inventory/particle logic.
- Codigo/Declares.bas: Updated e_RuneType ordering/values and added FastTravel enum value.
- Codigo/FileIO.bas: Fixed INI key names for recall stones (Runetype, HastaMap/HastaX/HastaY) and added reading of a Cooldown field.
- Codigo/InvUsuario.bas: Use the object's Cooldown to set the action timer (capped at 32766) instead of previously hardcoded timers per rune type.
- Codigo/modMessageIDs.bas: Added message ID constants for successful teleport and invalid fast-travel origin.

These changes enable configurable rune cooldowns, a new fast-travel rune behavior, and cleaner rune/action code paths. Ensure INI/object data uses the new key names and includes Cooldown values.
Replaced hardcoded numeric locale message IDs in Acciones.bas with descriptive constants for rune-related feedback (return home, teleport success, invalid rune, unusable in meson). Also removed an earlier .flags.Muerto conditional around determining the home city so the return-home path always computes and warps to the destination. Added three new constants in modMessageIDs.bas: MSG_SUCCESFULLY_RETURN_TO_HOME_CITY (1065), MSG_INVALID_RUNE (2080) and MSG_NOT_USABLE_INSIDE_MESON (2081). Minor cleanup of commented message lines.
Replace the inlined ReturnHome handling in CompletarAccionFin with a single HomeArrival(UserIndex) call to centralize home-teleport logic and reduce duplicated code. Also remove unused e_AccionBarra members (Resucitar, Intermundia, GoToPareja) from Declares.bas to clean up the enum. This simplifies maintenance; callers relying on the removed enum members should be updated accordingly.
Rename the action-completion routine from CompletarAccionFin to EndProgrammedAction and update all references. Updated trace/error labels accordingly in Codigo/Acciones.bas and Codigo/Protocol.bas. Refactored General.PasarSegundo to call EndProgrammedAction(i) instead of duplicating action-clear logic, and fixed several control-flow/indentation issues (missing End If/End With/Next placements) to ensure counters, portal and invasion timers are processed correctly. This centralizes the action-finalization behavior and resolves potential logic bugs in the per-second processing loop.
Replace temporary Map/x/y locals with direct obj.HastaMap/obj.HastaX/obj.HastaY arguments when calling WarpUserChar in Codigo/Acciones.bas, and remove the HechizoPortal subroutine plus its e_TipoHechizo.uPortal case in Codigo/modHechizos.bas. These changes clean up duplicated local variables and delete the portal spell handler from the spell dispatcher.
Add IsValidMapIndex and IsValidMapPosition to Codigo/ModMap.bas and remove duplicate map-validation code from Codigo/modFishing.bas. Also tidy modFishing: normalize formatting/spacing, align declarations, rename parameter to ObjectIndex in IsValidObjectIndex, clamp PoderCania before use, and make the random fish selection bounds handling more robust. Primarily refactor/cleanup and deduplicate logic; no major functional changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants