diff --git a/Transcendence/TransCore/KSMission01.xml b/Transcendence/TransCore/KSMission01.xml index 2e3633aeb..ffaedf931 100644 --- a/Transcendence/TransCore/KSMission01.xml +++ b/Transcendence/TransCore/KSMission01.xml @@ -47,7 +47,7 @@ (and (not (objGetObjRefData theFreighter "korolovDest")) (not (objGetData theFreighter "korolovPlayerEscort")) - (geq playerLevel (objGetStaticData theFreighter "korolovMinLevel")) + (geq playerLevel (korObjGetMinLevel theFreighter)) (geq (shpGetMaxSpeed gPlayerShip) (+ (shpGetMaxSpeed theFreighter) 2)) ) ) @@ -75,18 +75,6 @@ destObj ) (switch - ; Finite number of missions per station - (ls (objGetData aOwnerObj 'remainingMissions) 1) - (msnDestroy gSource) - - ; Only offer to new pilots and levels 1-3 - (not (find '(0 1 2 3) playerLevel)) - (msnDestroy gSource) - - ; No missions once the stronghold is destroyed - (objIsAbandoned (objGetObjRefData aOwnerObj 'charonStronghold)) - (msnDestroy gSource) - ; Pick a random freighter. If we can't find one there is no mission (and (not freighterObj) (not (setq freighterObj (random dockedFreighters))) @@ -120,7 +108,7 @@ ; Remember the minimum player level to escort and the minimum ; player speed. - (msnSetData gSource 'minPlayerLevel (objGetStaticData freighterObj "korolovMinLevel")) + (msnSetData gSource 'minPlayerLevel (korObjGetMinLevel freighterObj)) (msnSetData gSource 'minPlayerSpeed (+ (shpGetMaxSpeed freighterObj) 2)) ; Remember the mission for this transport, so we don't diff --git a/Transcendence/TransCore/KSMission02.xml b/Transcendence/TransCore/KSMission02.xml index 8762104df..27a422649 100644 --- a/Transcendence/TransCore/KSMission02.xml +++ b/Transcendence/TransCore/KSMission02.xml @@ -48,7 +48,7 @@ dockedFreighters theFreighter (and - (geq playerLevel (objGetStaticData theFreighter "korolovMinLevel")) + (geq playerLevel (korObjGetMinLevel theFreighter)) (geq (shpGetMaxSpeed gPlayerShip) (+ (shpGetMaxSpeed theFreighter) 2)) ) ) @@ -61,18 +61,6 @@ (switch - ; Finite number of missions per station - (ls (objGetData aOwnerObj 'remainingMissions) 1) - (msnDestroy gSource) - - ; Only offer to new pilots and levels 1-3 - (not (find '(0 1 2 3) playerLevel)) - (msnDestroy gSource) - - ; No missions once the stronghold is destroyed - (objIsAbandoned (objGetObjRefData aOwnerObj 'charonStronghold)) - (msnDestroy gSource) - ; If we're too close to the gates then no mission (not (setq gateObj (random (sysFindObject aOwnerObj "GR:300; -uncharted;")))) (msnDestroy gSource) @@ -101,7 +89,7 @@ ; Remember the minimum player level to escort and the minimum ; player speed. - (msnSetData gSource 'minPlayerLevel (typGetStaticData escortType "korolovMinLevel")) + (msnSetData gSource 'minPlayerLevel (korTypGetMinLevel escortType)) (msnSetData gSource 'minPlayerSpeed (+ (typGetProperty escortType 'maxSpeed) 2)) ) diff --git a/Transcendence/TransCore/KorolovFreighters.xml b/Transcendence/TransCore/KorolovFreighters.xml index f9a4e9d0e..2c171869a 100644 --- a/Transcendence/TransCore/KorolovFreighters.xml +++ b/Transcendence/TransCore/KorolovFreighters.xml @@ -90,25 +90,25 @@ combatStyle= "standOff" /> - - - ( - 0 ; new pilots cannot escort - 0 ; apprentices cannot escort - 0 ; journeymen cannot escort - - ; Masters: 45 - 150 credits per container - ; 54,000 - 180,000 cargo value - (multiply 5 (add (random 3 10) (random 3 10) (random 3 10))) - - 150 ; legends don't escort, but add anyway - ) - - - 350 - - 3 - + + ; new pilots cannot escort + ; apprentices cannot escort + ; journeymen cannot escort + + + ; Masters: 45 - 150 credits per container + ; 54,000 - 180,000 cargo value + (multiply 5 (add (random 3 10) (random 3 10) (random 3 10))) + + + + 150 ; Legends: requires sandbox mode to be activated + + + + 350 + + @@ -214,28 +214,30 @@ combatStyle= "standOff" /> - - - ( - 0 ; new pilots cannot escort - 0 ; apprentices cannot escort - - ; Journeymen: 100 - 240 credits per container - ; 120,000 - 288,000 - (multiply 2 (add (random 20 40) (random 20 40) (random 10 40))) + + ; new pilots cannot escort + ; apprentices cannot escort - ; Masters: 200 - 400 credits per container - ; 240,000 - 480,000 - (multiply 2 (add (random 30 60) (random 30 60) (random 40 80))) + + ; Journeymen: 100 - 240 credits per container + ; 120,000 - 288,000 + (multiply 2 (add (random 20 40) (random 20 40) (random 10 40))) + - 400 ; legends don't escort, but add anyway - ) - + + ; Masters: 200 - 400 credits per container + ; 240,000 - 480,000 + (multiply 2 (add (random 30 60) (random 30 60) (random 40 80))) + - 100 + + 400 ; Legends: requires sandbox mode to be activated + - 2 - + + 100 + + @@ -341,28 +343,30 @@ combatStyle= "standOff" /> - - - ( - 0 ; new pilots cannot escort - 0 ; apprentices cannot escort - - ; Journeymen: 80 - 160 credits - ; 160,000 - 320,000 cargo value - (multiply 10 (add (random 2 4) (random 2 4) (random 2 4) (random 2 4))) + + ; new pilots cannot escort + ; apprentices cannot escort - ; Masters: 160 - 400 credits - ; 320,000 - 800,000 cargo value - (add (multiply 10 (add (random 4 10) (random 4 10))) (multiply 10 (add (random 4 10) (random 4 10)))) + + ; Journeymen: 80 - 160 credits + ; 160,000 - 320,000 cargo value + (multiply 10 (add (random 2 4) (random 2 4) (random 2 4) (random 2 4))) + - 400 ; legends don't escort, but add anyway - ) - + + ; Masters: 160 - 400 credits + ; 320,000 - 800,000 cargo value + (add (multiply 10 (add (random 4 10) (random 4 10))) (multiply 10 (add (random 4 10) (random 4 10)))) + - 50 + + 400 ; Legends: requires sandbox mode to be activated + - 2 - + + 50 + + @@ -425,33 +429,39 @@ perception= "4" /> - - - ( - ; New pilot: 1500 - 4000 credits - ; 15,000 - 20,000 cargo value - (multiply 100 (random 15 20)) - - ; Apprentices: 1500 - 4000 credits - ; 15,000 - 30,000 cargo value - (multiply 100 (random 15 30)) - - ; Journeymen: 2500 - 5000 credits - ; 25,000 - 50,000 cargo value - (multiply 100 (random 25 50)) - - ; Masters: 3000 - 5000 credits - ; 30,000 - 50,000 cargo value - (multiply 100 (random 30 50)) - - 5000 ; legends don't escort, but add anyway - ) - - - 200 - - 0 - + + + ; New pilot: 1500 - 4000 credits + ; 15,000 - 20,000 cargo value + (multiply 100 (random 15 20)) + + + + ; Apprentices: 1500 - 4000 credits + ; 15,000 - 30,000 cargo value + (multiply 100 (random 15 30)) + + + + ; Journeymen: 2500 - 5000 credits + ; 25,000 - 50,000 cargo value + (multiply 100 (random 25 50)) + + + + ; Masters: 3000 - 5000 credits + ; 30,000 - 50,000 cargo value + (multiply 100 (random 30 50)) + + + + 5000 ; Legends: requires sandbox mode to be activated + + + + 200 + + @@ -516,33 +526,39 @@ perception= "4" /> - - - ( - ; New pilot: 800 - 2000 credits - ; 20,000 - 40,000 cargo value - (multiply 100 (random 10 20)) - - ; Apprentices: 1200 - 2500 credits - ; 24,000 - 50,000 cargo value - (multiply 100 (random 12 25)) - - ; Journeymen: 1500 - 4000 credits - ; 30,000 - 80,000 cargo value - (multiply 100 (random 15 40)) - - ; Masters: 3000 - 5000 credits - ; 60,000 - 100,000 cargo value - (multiply 100 (random 30 50)) - - 5000 ; legends don't escort, but add anyway - ) - - - 150 - - 0 - + + + ; New pilot: 800 - 2000 credits + ; 20,000 - 40,000 cargo value + (multiply 100 (random 10 20)) + + + + ; Apprentices: 1200 - 2500 credits + ; 24,000 - 50,000 cargo value + (multiply 100 (random 12 25)) + + + + ; Journeymen: 1500 - 4000 credits + ; 30,000 - 80,000 cargo value + (multiply 100 (random 15 40)) + + + + ; Masters: 3000 - 5000 credits + ; 60,000 - 100,000 cargo value + (multiply 100 (random 30 50)) + + + + 5000 ; Legends: requires sandbox mode to be activated + + + + 150 + + @@ -555,7 +571,7 @@ The EI200 class freighter is a larger and faster version of the 100 series. It has double the cargo capacity and upgraded armor and weapons. It is designed to transport small quantities of high-value cargo. The EI200 is - so well defended that even Apprentices are allowed to escort them. + so well defended that even Apprentices and new pilots are allowed to escort them. @@ -603,28 +619,30 @@ perception= "4" /> - - - ( - 0 ; new pilots cannot escort - 0 ; apprentices cannot escort - - ; Journeymen: 2000 - 4000 credits - ; 160,000 - 320,000 cargo value - (multiply 100 (add (random 10 20) (random 10 20))) - - ; Masters: 4000 - 10000 credits - ; 320,000 - 800,000 cargo value - (multiply 100 (add (random 20 50) (random 20 50))) - - 5000 ; legends don't escort, but add anyway - ) - - - 50 - - 2 - + + ; new pilots cannot escort + ; apprentices cannot escort + + + ; Journeymen: 2000 - 4000 credits + ; 160,000 - 320,000 cargo value + (multiply 100 (add (random 10 20) (random 10 20))) + + + + ; Masters: 4000 - 10000 credits + ; 320,000 - 800,000 cargo value + (multiply 100 (add (random 20 50) (random 20 50))) + + + + 10000 ; Legends: requires sandbox mode to be activated + + + + 50 + + diff --git a/Transcendence/TransCore/KorolovShipping.xml b/Transcendence/TransCore/KorolovShipping.xml index e0b9b07ec..45bf4ad68 100644 --- a/Transcendence/TransCore/KorolovShipping.xml +++ b/Transcendence/TransCore/KorolovShipping.xml @@ -59,6 +59,20 @@ 0 0 + + + + @@ -335,6 +349,14 @@ (rpgCharacterRandom gSource "x +assistantDirector; +korolov;" 'assistantDirector) + + (random + ; min delay of 2 minutes + (* 30 120) + ; max delay of 5 minutes + (* 30 300)) + + @@ -478,14 +500,14 @@ (= playerLevel -1) (scrShowScreen gScreen &dsRPGDialog; { desc:(scrTranslate gScreen 'descTooManyFailures) }) - ; Already a legend + ; Already a legend and not in sandbox mode - (= playerLevel 4) + (and (= playerLevel 4) (not (korIsSandboxMode))) (scrShowScreen gScreen &dsRPGDialog; { desc:(scrTranslate gScreen 'descAlreadyALegend) }) - ; If the main stronghold is destroyed, no need for escorts + ; If the main stronghold is destroyed and not in sandbox mode, no need for escorts - (objIsAbandoned (objGetObjRefData gSource 'charonStronghold)) + (and (objIsAbandoned (objGetObjRefData gSource 'charonStronghold)) (not (korIsSandboxMode))) (scrShowScreen gScreen &dsRPGDialog; { desc:(scrTranslate gScreen 'descNoEscortsNeeded) }) ; If we failed to destroy stronghold, we stop missions @@ -493,9 +515,9 @@ (objGetData gSource 'charonDominates) (scrShowScreen gScreen &dsRPGDialog; { desc:(scrTranslate gScreen 'descFreightersGrounded) }) - ; If the Charon Fortress is destroyed, no missions + ; If the Charon Fortress is destroyed and not in sandbox mode, no missions - (= (typGetGlobalData &stCharonPirateFortress; 'status) 'destroyed) + (and (= (typGetGlobalData &stCharonPirateFortress; 'status) 'destroyed) (not (korIsSandboxMode))) (scrShowScreen gScreen &dsRPGDialog; { desc:(scrTranslate gScreen 'descFortressDestroyed) }) ; If we're giving out escort missions, then show the list of @@ -555,7 +577,7 @@ (shipList (sort (map (korFreighterTypes) theType { class:theType name:(shpGetClassName theType 0x080) - level:(max (typGetStaticData theType 'korolovMinLevel) 1) + level:(max (korTypGetMinLevel theType) 1) }) 'ascending 'name)) (levelList (map (make 'sequence 3) level (filter shipList theShip (= (@ theShip 'level) level)))) @@ -672,12 +694,21 @@ - (block (charonStronghold) + (block ( + charonStronghold + (remainingMissions (+ 3 (modulo (objGetDestiny gSource) 7))) + ) ; Register a recurring event (sysAddObjRecurringTimerEvent 240 gSource "OnTrafficControl") ; Allow a finite number of escort missions from each station - (objSetData gSource 'remainingMissions (+ 3 (modulo (objGetDestiny gSource) 7))) + (objSetData gSource 'remainingMissions remainingMissions) + + ; If we are in sandbox mode setup an event to gradually replenish missions + (if (korIsSandboxMode) (block () + (objSet@ gSource 'maxRemainingMissions remainingMissions) + (sysAddObjTimerEvent (@ gSource 'missionReplenishDelay) gSource 'SandboxModeRefreshMissions) + )) ; Find the primary Charon stronghold in the system (setq charonStronghold (chrGetPrimaryStronghold gSource)) @@ -734,6 +765,17 @@ } ) + + + (block () + ; Add a new mission if we dont have enough + (if (ls (objGetData gSource 'remainingMissions) (obj@ gSource 'maxRemainingMissions)) + (objIncData gSource 'remainingMissions 1) + ) + ; Set the next event + (sysAddObjTimerEvent (@ gSource 'missionReplenishDelay) gSource 'SandboxModeRefreshMissions) + ) + @@ -1570,6 +1612,55 @@ (block Nil + (setq korTypGetMinLevel (lambda (typ) + "Get the minimum rank required for escorting this type" + (or + (switch + ; New method via properties + (typ@ typ 'korolov.containerPrice.0) + 0 + (typ@ typ 'korolov.containerPrice.1) + 1 + (typ@ typ 'korolov.containerPrice.2) + 2 + (typ@ typ 'korolov.containerPrice.3) + 3 + (typ@ typ 'korolov.containerPrice.4) + 4 + + ; Legacy method + (typ@ typ 'korolovMinLevel) + ) + ) + )) + + (setq korObjGetMinLevel (lambda (obj) + "Get the minimum rank required for escorting this object" + (or + (switch + ; New method via properties + (obj@ obj 'korolov.containerPrice.0) + 0 + (obj@ obj 'korolov.containerPrice.1) + 1 + (obj@ obj 'korolov.containerPrice.2) + 2 + (obj@ obj 'korolov.containerPrice.3) + 3 + (obj@ obj 'korolov.containerPrice.4) + 4 + + ; Legacy method + (obj@ obj 'korolovMinLevel) + ) + ) + )) + + (setq korIsSandboxMode (lambda () + "Returns a non-nil value if sandbox mode is enabled" + (typ@ &unidKorolovShipping; 'sandboxMode) + )) + ; korInitMissions ; ; Initializes missions for every freighter docked at the station and missions @@ -1854,6 +1945,7 @@ (successes (@ transRecord 0)) (failures (@ transRecord 1)) (totalMissions (+ successes failures)) + (minLevel (korTypGetMinLevel shipClass)) ) (switch (and transRecord (= failures 0)) @@ -1865,7 +1957,7 @@ (and transRecord (!= totalMissions 0)) (cat successes " out of " totalMissions " successful missions (" (divide (multiply 100 successes) totalMissions) "%)") - (gr (typGetStaticData shipClass "korolovMinLevel") (korGetPlayerLevel)) + (gr minLevel (korGetPlayerLevel)) "Not rated to escort this class" "No missions completed" @@ -1873,17 +1965,17 @@ ) )) - ; Return a list of ShipClasses to use as Korolov freighters (setq korFreighterTypes (lambda (maxLev) + "Return a list of ShipClasses to use as Korolov freighters" (block ( (lev (if maxLev maxLev 999)) ) (filter - (typFind "s +freighter +commonwealth") + (typFind "s +freighter") typ (and - (typGetStaticData typ 'korolovMinLevel) - (geq lev (typGetStaticData typ 'korolovMinLevel)) + (korTypGetMinLevel typ) + (geq lev (korTypGetMinLevel typ)) ) ) ) @@ -1909,10 +2001,15 @@ ) )) - ; Calculate the cargo value and escort fees for a Korolov freighter (setq korCalculateCargo (lambda (escortType escortLevel oneWay) + "Calculate the cargo value and escort fees for a Korolov freighter" (block ( - (escortRate (typGetStaticData escortType 'korolovEscortRate)) + (escortRate (or + ; New method + (typ@ escortType 'korolov.escortRate) + + (typGetStaticData escortType 'korolovEscortRate) + )) (fitCount (/ (typGetProperty escortType 'cargoSpace) 25)) pricePerContainer cargoValue escortFee ) @@ -1920,6 +2017,9 @@ ; Figure out the price per container of the cargo (setq pricePerContainer (or ; New method + (typ@ escortType (cat 'korolov.containerPrice. escortLevel)) + + ; 1.8-1.9 method (eval (@ (typGetStaticData escortType 'korolov.containerPrice) escortLevel)) ; Legacy method (1.7 and before) @@ -1996,7 +2096,7 @@ - +