Loading...
Searching...
No Matches
PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost Class Reference

Add this script to a trade post to integrate it with Love/Hate. More...

Inheritance diagram for PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost:
Collaboration diagram for PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost:

Public Member Functions

void RecordOriginalPrices ()
 Records the trader's current prices as the original prices.
 
void RestoreOriginalPrices ()
 Restores the original prices.
 
void AdjustPricesForFaction (Faction faction)
 Adjusts the post's prices to sell to a faction.
 
void AdjustPricesForFaction (Faction faction, bool buyingFromFaction)
 Adjusts the post's prices for a faction.
 

Public Attributes

AnimationCurve priceCurve
 The price adjustment curve.
 
bool debug = false
 Tick to log debug information for this post.
 

Properties

Dictionary< string, float > originalPrice [get]
 The original prices of the items, indexed by item name.
 

Detailed Description

Add this script to a trade post to integrate it with Love/Hate.

It introduces one method: AdjustPricesForFaction(). Assign a Love/Hate faction member to the post. Then call this method before a trader interacts with the post to adjust the post's prices based on the trader's Love/Hate faction. This script doesn't use TradeSys factions.

Member Function Documentation

◆ AdjustPricesForFaction() [1/2]

void PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.AdjustPricesForFaction ( Faction  faction)
inline

Adjusts the post's prices to sell to a faction.

Parameters
factionFaction to sell to.

◆ AdjustPricesForFaction() [2/2]

void PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.AdjustPricesForFaction ( Faction  faction,
bool  buyingFromFaction 
)
inline

Adjusts the post's prices for a faction.

If trading with a friendly faction, adjust prices toward the right end of the curve (lower prices). If trading with an enemy faction, sell to the faction at high prices and buy at low prices.

Parameters
factionFaction to sell to or buy from.
buyingFromFactionIf true, set prices for buying from the faction; if false, selling to faction.

◆ RecordOriginalPrices()

void PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.RecordOriginalPrices ( )
inline

Records the trader's current prices as the original prices.

◆ RestoreOriginalPrices()

void PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.RestoreOriginalPrices ( )
inline

Restores the original prices.

Member Data Documentation

◆ debug

bool PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.debug = false

Tick to log debug information for this post.

◆ priceCurve

AnimationCurve PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.priceCurve
Initial value:
= new AnimationCurve(new Keyframe[] {
new Keyframe(-100, 100),
new Keyframe(0, 1),
new Keyframe(100, 0.1f) })

The price adjustment curve.

Scales the base price by this affinity value. For example, if the post's affinity to the trader is 50, and the curve's value at 50 is 0.25, then prices will be discounted by 25%.

Property Documentation

◆ originalPrice

Dictionary<string,float> PixelCrushers.LoveHate.TradeSysSupport.LoveHateTradePost.originalPrice
get

The original prices of the items, indexed by item name.


The documentation for this class was generated from the following file: