mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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:
parent
adaf8ef6f4
commit
060b8cc0ec
@ -18,6 +18,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(10, "common.items.consumable.potion_big"),
|
(10, "common.items.consumable.potion_big"),
|
||||||
|
(10, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(10, "common.items.consumable.potion_big"),
|
(10, "common.items.consumable.potion_big"),
|
||||||
|
(10, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(10, "common.items.consumable.potion_big"),
|
(10, "common.items.consumable.potion_big"),
|
||||||
|
(10, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(25, "common.items.consumable.potion_big"),
|
(25, "common.items.consumable.potion_big"),
|
||||||
|
(25, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(10, "common.items.consumable.potion_big"),
|
(10, "common.items.consumable.potion_big"),
|
||||||
|
(10, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [],
|
meta: [],
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(10, "common.items.consumable.potion_big"),
|
(10, "common.items.consumable.potion_big"),
|
||||||
|
(10, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [],
|
meta: [],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(5, "common.items.consumable.potion_minor"),
|
(5, "common.items.consumable.potion_minor"),
|
||||||
|
(5, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(25, "common.items.consumable.potion_minor"),
|
(25, "common.items.consumable.potion_minor"),
|
||||||
|
(25, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(50, "common.items.consumable.potion_med"),
|
(50, "common.items.consumable.potion_med"),
|
||||||
|
(50, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
)),
|
)),
|
||||||
items: [
|
items: [
|
||||||
(50, "common.items.consumable.potion_big"),
|
(50, "common.items.consumable.potion_big"),
|
||||||
|
(50, "common.items.food.sunflower_icetea"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
meta: [
|
meta: [
|
||||||
|
@ -19,7 +19,7 @@ ItemDef(
|
|||||||
kind: PotionSickness,
|
kind: PotionSickness,
|
||||||
data: (
|
data: (
|
||||||
strength: 0.33,
|
strength: 0.33,
|
||||||
duration: Some(( secs: 60, nanos: 0, )),
|
duration: Some(( secs: 45, nanos: 0, )),
|
||||||
delay: Some(( secs: 1, nanos: 0, ))
|
delay: Some(( secs: 1, nanos: 0, ))
|
||||||
),
|
),
|
||||||
cat_ids: [Natural],
|
cat_ids: [Natural],
|
||||||
|
@ -19,7 +19,7 @@ ItemDef(
|
|||||||
kind: PotionSickness,
|
kind: PotionSickness,
|
||||||
data: (
|
data: (
|
||||||
strength: 0.33,
|
strength: 0.33,
|
||||||
duration: Some(( secs: 60, nanos: 0, )),
|
duration: Some(( secs: 45, nanos: 0, )),
|
||||||
delay: Some(( secs: 1, nanos: 0, ))
|
delay: Some(( secs: 1, nanos: 0, ))
|
||||||
),
|
),
|
||||||
cat_ids: [Natural],
|
cat_ids: [Natural],
|
||||||
|
@ -19,7 +19,7 @@ ItemDef(
|
|||||||
kind: PotionSickness,
|
kind: PotionSickness,
|
||||||
data: (
|
data: (
|
||||||
strength: 0.33,
|
strength: 0.33,
|
||||||
duration: Some(( secs: 60, nanos: 0, )),
|
duration: Some(( secs: 45, nanos: 0, )),
|
||||||
delay: Some(( secs: 1, nanos: 0, ))
|
delay: Some(( secs: 1, nanos: 0, ))
|
||||||
),
|
),
|
||||||
cat_ids: [Natural],
|
cat_ids: [Natural],
|
||||||
|
@ -19,7 +19,7 @@ ItemDef(
|
|||||||
kind: PotionSickness,
|
kind: PotionSickness,
|
||||||
data: (
|
data: (
|
||||||
strength: 0.33,
|
strength: 0.33,
|
||||||
duration: Some(( secs: 60, nanos: 0, )),
|
duration: Some(( secs: 45, nanos: 0, )),
|
||||||
delay: Some(( secs: 1, nanos: 0, ))
|
delay: Some(( secs: 1, nanos: 0, ))
|
||||||
),
|
),
|
||||||
cat_ids: [Natural],
|
cat_ids: [Natural],
|
||||||
|
@ -528,12 +528,14 @@ impl<'a> AgentData<'a> {
|
|||||||
controller: &mut Controller,
|
controller: &mut Controller,
|
||||||
relaxed: bool,
|
relaxed: bool,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// Wait for potion sickness to wear off if potions are less than 20% effective.
|
// Wait for potion sickness to wear off if potions are less than 50% effective.
|
||||||
if self.stats.map_or(1.0, |s| s.heal_multiplier) < 0.2 {
|
let heal_multiplier = self.stats.map_or(1.0, |s| s.heal_multiplier);
|
||||||
|
if heal_multiplier < 0.5 {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let healing_value = |item: &Item| {
|
let healing_value = |item: &Item| {
|
||||||
let mut value = 0.0;
|
let mut value = 0.0;
|
||||||
|
let mut causes_potion_sickness = false;
|
||||||
|
|
||||||
if let ItemKind::Consumable { kind, effects, .. } = &*item.kind() {
|
if let ItemKind::Consumable { kind, effects, .. } = &*item.kind() {
|
||||||
if matches!(kind, ConsumableKind::Drink)
|
if matches!(kind, ConsumableKind::Drink)
|
||||||
@ -551,11 +553,22 @@ impl<'a> AgentData<'a> {
|
|||||||
value += data.strength
|
value += data.strength
|
||||||
* data.duration.map_or(0.0, |d| d.as_secs() as f32);
|
* 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
|
value as i32
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user