Skip to content

Commit

Permalink
more sensible hypersonics progression
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Just-Luci committed Feb 21, 2025
1 parent c6a601c commit c382c0b
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CONTRACT_TYPE
{
name = CompleteContract
type = CompleteContract
contractType = AdvXPlanesSupersonicHeavy
contractType = AdvXPlanesUncrewedHypersonic
}

REQUIREMENT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
CONTRACT_TYPE
{
name = AdvXPlanesUncrewedHypersonic
group = AdvXPlanes

title = Advanced X-Planes (Uncrewed Hypersonic)

tag = exclude_Supersonic

description = <b>Program: Advanced X-Plane Research<br>Type: <color=blue>Optional</color></b><br><br>Design, build, and fly a crewed jet aircraft to maintain @VesselGroup/HoldSituation/minSpeed m/s in level flight, then return home safely. Optionally, landing back at the runway will award extra reputation. If playing from the Cape, the Space Shuttle runway provided by the RSS-CanaveralHD mod is also a valid landing target.<br><br>The reward of this contract will slowly increase over time but will be reset to 0 after each completion.<br><b>Current reward is at @rewardFactorPercent % of its nominal value. Elapsed/Expected Days: @elapsedDays / @RP0:expectedDays_XPlanesSupersonicOptional</b><br><br>This is a series of @maxCompletions contracts, of which @completions have been completed.
genericDescription = Design, build, and fly a crewed jet aircraft to maintain a specific speed in level flight, then return home safely.

synopsis = Fly a crewed jet aircraft to maintain @VesselGroup/HoldSituation/minSpeed m/s in level flight and hold, then return safely.

completedMessage = Congratulations on a successful flight!

sortKey = 4503

deadline = 0
cancellable = true
declinable = true
autoAccept = false
minExpiry = 1
maxExpiry = 1

targetBody = HomeWorld()

maxCompletions = 7
maxSimultaneous = 1
prestige = Trivial

// ************ REWARDS ************
prestige = Trivial // 1.0x
advanceFunds = 0
rewardScience = 0
rewardFunds = 0
failureFunds = 0
rewardReputation = (30 + @completions * 5) * @rewardFactor
failureReputation = 0 // was @rewardReputation

DATA
{
type = int
antiGrindCompletion = $XPSS_Completion == 0 ? (UniversalTime() - @RP0:expectedDays_XPlanesSupersonicOptional * 86400) : $XPSS_Completion
}

DATA
{
type = int
index = $RP0_XPSS_High_Difficulty
completions = $RP0_XPSS_High_Difficulty
}

DATA
{
type = float
elapsedDays = Round((UniversalTime() - @antiGrindCompletion) / 86400.0)
rewardFactor = Log(Max(@elapsedDays / @RP0:expectedDays_XPlanesSupersonicOptional * 20 - 9, 1), 2) / 3.46
rewardFactorPercent = Round(@rewardFactor * 100, 1)
}

// ************* REQUIREMENTS ****************

REQUIREMENT
{
name = ProgramActive
type = ProgramActive
program = AdvXPlanes
}

REQUIREMENT
{
name = AcceptContract
type = AcceptContract
tag = exclude_Supersonic
invertRequirement = true
}

BEHAVIOUR
{
name = IncrementTheCount
type = Expression

CONTRACT_OFFERED
{

XPSS_Completion = ($XPSS_Completion + 0) == 0 ? (UniversalTime() - @RP0:expectedDays_XPlanesSupersonicOptional * 86400) : ($XPSS_Completion + 0)

}

CONTRACT_COMPLETED_SUCCESS
{
XPSS_Completion = UniversalTime()
}
}

BEHAVIOUR
{
name = SetSSDifficulty
type = Expression


CONTRACT_COMPLETED_SUCCESS
{
RP0_XPSS_High_Difficulty = $RP0_XPSS_High_Difficulty + 1
}
}


PARAMETER
{
name = VesselGroup
type = VesselParameterGroup
title = Maintain between @HoldSituation/minSpeed m/s and @HoldSituation/maxSpeed m/s in level flight with a crewed jet aircraft.
define = supersonicCraft
dissassociateVesselsOnContractCompletion = true
resetChildrenWhenVesselDestroyed = true

PARAMETER
{
name = BuiltAtSPH
type = VesselBuiltAt
builtAt = SPH
}

PARAMETER
{
name = NoCrew
type = HasCrew
minCrew = 0
maxCrew = 0
title = Uncrewed vessel
hideChildren = true
}

PARAMETER
{
name = NoRocket
type = PartValidation
title = Vessel is a jet (no rocket engines allowed)
hideChildren = true
NONE
{
partModule = ModuleEnginesRF
partModule = ModuleEnginesAJEPropeller
}
}

PARAMETER
{
name = HoldSituation
type = ReachState
minSpeed = 1625
maxSpeed = 1787.5
minRateOfClimb = -10
maxRateOfClimb = 10
situation = FLYING

title = Hold between @minSpeed m/s to @maxSpeed m/s in level flight.

disableOnStateChange = true

PARAMETER
{
name = Duration
type = Duration
duration = 3m
preWaitText = Reach specified speed.
waitingText = Testing highspeed flight
completionText = Flight completed, you are cleared to land.
}
}
}
}

0 comments on commit c382c0b

Please sign in to comment.