feat: let trusted villagers ask the player directly as standing grows
This commit is contained in:
@@ -4,6 +4,8 @@ extends RefCounted
|
||||
const PANTRY_STANDING_REWARD := 8.0
|
||||
const WOOD_STANDING_REWARD := 8.0
|
||||
const ANIMAL_CARE_STANDING_REWARD := 6.0
|
||||
const PERSONAL_TRUST_THRESHOLD := 0.5
|
||||
const MIN_PERSONAL_REQUEST_TIER := PlayerStandingRecord.TIER_KNOWN_HAND
|
||||
|
||||
var quests: Array[PlayerQuestRecord] = []
|
||||
var next_quest_id := 0
|
||||
@@ -77,14 +79,12 @@ func on_animal_fed(
|
||||
func consider_opportunity_opened(
|
||||
opportunity: OpportunityStateRecord,
|
||||
player_response: OpportunityPlayerResponseResult,
|
||||
current_tick: int
|
||||
current_tick: int,
|
||||
personal_request_eligible := false
|
||||
) -> PlayerQuestRecord:
|
||||
if (
|
||||
opportunity == null
|
||||
or not opportunity.is_open()
|
||||
or player_response == null
|
||||
or current_tick < 0
|
||||
):
|
||||
if opportunity == null or not opportunity.is_open() or current_tick < 0:
|
||||
return null
|
||||
if player_response == null and not personal_request_eligible:
|
||||
return null
|
||||
if _find_open_quest_for_opportunity(opportunity.get_opportunity_id()) != null:
|
||||
return null
|
||||
@@ -107,6 +107,16 @@ func consider_opportunity_opened(
|
||||
return quest
|
||||
|
||||
|
||||
func can_request_personally(opportunity: OpportunityStateRecord) -> bool:
|
||||
if (
|
||||
opportunity == null
|
||||
or not opportunity.is_open()
|
||||
or standing.get_tier() < MIN_PERSONAL_REQUEST_TIER
|
||||
):
|
||||
return false
|
||||
return standing.get_gratitude(opportunity.get_interested_npc_id()) >= PERSONAL_TRUST_THRESHOLD
|
||||
|
||||
|
||||
func on_opportunity_resolved(
|
||||
opportunity: OpportunityStateRecord, resolution_event: EconomicEventRecord, current_tick: int
|
||||
) -> Dictionary:
|
||||
|
||||
Reference in New Issue
Block a user