Decrease the duration of potion sickness to 45 seconds. Make agents more averse to incurring further stacks of potion sickness, and give villagers iced tea.

This commit is contained in:
Avi Weinstock 2023-01-18 16:17:24 -05:00
parent adaf8ef6f4
commit 060b8cc0ec
15 changed files with 38 additions and 15 deletions

View File

@ -18,9 +18,10 @@
)),
items: [
(10, "common.items.consumable.potion_big"),
(10, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank3.fullskill"),
],
)
)

View File

@ -18,9 +18,10 @@
)),
items: [
(10, "common.items.consumable.potion_big"),
(10, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank3.fullskill"),
],
)
)

View File

@ -18,9 +18,10 @@
)),
items: [
(10, "common.items.consumable.potion_big"),
(10, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank3.fullskill"),
],
)
)

View File

@ -15,9 +15,10 @@
)),
items: [
(25, "common.items.consumable.potion_big"),
(25, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank3.fullskill"),
],
)
)

View File

@ -18,7 +18,8 @@
)),
items: [
(10, "common.items.consumable.potion_big"),
(10, "common.items.food.sunflower_icetea"),
],
),
meta: [],
)
)

View File

@ -21,7 +21,8 @@
)),
items: [
(10, "common.items.consumable.potion_big"),
(10, "common.items.food.sunflower_icetea"),
],
),
meta: [],
)
)

View File

@ -22,9 +22,10 @@
)),
items: [
(5, "common.items.consumable.potion_minor"),
(5, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank1.fullskill"),
],
)
)

View File

@ -22,9 +22,10 @@
)),
items: [
(25, "common.items.consumable.potion_minor"),
(25, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank2.fullskill"),
],
)
)

View File

@ -33,9 +33,10 @@
)),
items: [
(50, "common.items.consumable.potion_med"),
(50, "common.items.food.sunflower_icetea"),
],
),
meta: [
SkillSetAsset("common.skillset.preset.rank3.fullskill"),
],
)
)

View File

@ -33,6 +33,7 @@
)),
items: [
(50, "common.items.consumable.potion_big"),
(50, "common.items.food.sunflower_icetea"),
],
),
meta: [

View File

@ -19,7 +19,7 @@ ItemDef(
kind: PotionSickness,
data: (
strength: 0.33,
duration: Some(( secs: 60, nanos: 0, )),
duration: Some(( secs: 45, nanos: 0, )),
delay: Some(( secs: 1, nanos: 0, ))
),
cat_ids: [Natural],

View File

@ -19,7 +19,7 @@ ItemDef(
kind: PotionSickness,
data: (
strength: 0.33,
duration: Some(( secs: 60, nanos: 0, )),
duration: Some(( secs: 45, nanos: 0, )),
delay: Some(( secs: 1, nanos: 0, ))
),
cat_ids: [Natural],

View File

@ -19,7 +19,7 @@ ItemDef(
kind: PotionSickness,
data: (
strength: 0.33,
duration: Some(( secs: 60, nanos: 0, )),
duration: Some(( secs: 45, nanos: 0, )),
delay: Some(( secs: 1, nanos: 0, ))
),
cat_ids: [Natural],

View File

@ -19,7 +19,7 @@ ItemDef(
kind: PotionSickness,
data: (
strength: 0.33,
duration: Some(( secs: 60, nanos: 0, )),
duration: Some(( secs: 45, nanos: 0, )),
delay: Some(( secs: 1, nanos: 0, ))
),
cat_ids: [Natural],

View File

@ -528,12 +528,14 @@ impl<'a> AgentData<'a> {
controller: &mut Controller,
relaxed: bool,
) -> bool {
// Wait for potion sickness to wear off if potions are less than 20% effective.
if self.stats.map_or(1.0, |s| s.heal_multiplier) < 0.2 {
// Wait for potion sickness to wear off if potions are less than 50% effective.
let heal_multiplier = self.stats.map_or(1.0, |s| s.heal_multiplier);
if heal_multiplier < 0.5 {
return false;
}
let healing_value = |item: &Item| {
let mut value = 0.0;
let mut causes_potion_sickness = false;
if let ItemKind::Consumable { kind, effects, .. } = &*item.kind() {
if matches!(kind, ConsumableKind::Drink)
@ -551,11 +553,22 @@ impl<'a> AgentData<'a> {
value += data.strength
* data.duration.map_or(0.0, |d| d.as_secs() as f32);
},
Effect::Buff(BuffEffect { kind, .. })
if matches!(kind, PotionSickness) =>
{
causes_potion_sickness = true;
},
_ => {},
}
}
}
}
// Prefer non-potion sources of healing when under at least one stack of potion
// sickness, or when incurring potion sickness is unnecessary
if causes_potion_sickness && (heal_multiplier < 1.0 || relaxed) {
value *= 0.1;
}
value as i32
};