mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add migration for starter gear
This commit is contained in:
parent
152156d065
commit
46c8c744fa
@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Skill trees
|
- Skill trees
|
||||||
- Lactose tolerant golems
|
- Lactose tolerant golems
|
||||||
- 6 different gems. (Topaz, Amethyst, Sapphire, Emerald, Ruby and Diamond)
|
- 6 different gems. (Topaz, Amethyst, Sapphire, Emerald, Ruby and Diamond)
|
||||||
|
- Poise system (not currently accessible to players for balancing reasons)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -4,7 +4,10 @@ ItemDef(
|
|||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Bag("TestBag18Slot"),
|
kind: Bag("TestBag18Slot"),
|
||||||
stats: (protection: Normal(0.0)),
|
stats: (
|
||||||
|
protection: Normal(0.0),
|
||||||
|
poise_protection: Normal(0.0),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
|
@ -4,7 +4,10 @@ ItemDef(
|
|||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Bag("TestBag9Slot"),
|
kind: Bag("TestBag9Slot"),
|
||||||
stats: (protection: Normal(0.0)),
|
stats: (
|
||||||
|
protection: Normal(0.0),
|
||||||
|
poise_protection: Normal(0.0),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: High,
|
quality: High,
|
||||||
|
@ -5,7 +5,9 @@ ItemDef(
|
|||||||
(
|
(
|
||||||
kind: Foot("Dark"),
|
kind: Foot("Dark"),
|
||||||
stats: (
|
stats: (
|
||||||
protection: Normal(0.0)),
|
protection: Normal(0.0),
|
||||||
|
poise_protection: Normal(0.0),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
quality: Low,
|
quality: Low,
|
||||||
|
@ -68,10 +68,17 @@ impl Armor {
|
|||||||
pub fn get_poise_protection(&self) -> Protection { self.stats.poise_protection }
|
pub fn get_poise_protection(&self) -> Protection { self.stats.poise_protection }
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn test_armor(kind: ArmorKind, protection: Protection) -> Armor {
|
pub fn test_armor(
|
||||||
|
kind: ArmorKind,
|
||||||
|
protection: Protection,
|
||||||
|
poise_protection: Protection,
|
||||||
|
) -> Armor {
|
||||||
Armor {
|
Armor {
|
||||||
kind,
|
kind,
|
||||||
stats: Stats { protection },
|
stats: Stats {
|
||||||
|
protection,
|
||||||
|
poise_protection,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,6 +336,7 @@ mod tests {
|
|||||||
.get_slot_to_equip_into(&ItemKind::Armor(Armor::test_armor(
|
.get_slot_to_equip_into(&ItemKind::Armor(Armor::test_armor(
|
||||||
ArmorKind::Bag("test".to_string()),
|
ArmorKind::Bag("test".to_string()),
|
||||||
Protection::Normal(0.0),
|
Protection::Normal(0.0),
|
||||||
|
Protection::Normal(0.0),
|
||||||
)))
|
)))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
@ -355,6 +356,7 @@ mod tests {
|
|||||||
.get_slot_to_equip_into(&ItemKind::Armor(Armor::test_armor(
|
.get_slot_to_equip_into(&ItemKind::Armor(Armor::test_armor(
|
||||||
ArmorKind::Bag("test".to_string()),
|
ArmorKind::Bag("test".to_string()),
|
||||||
Protection::Normal(0.0),
|
Protection::Normal(0.0),
|
||||||
|
Protection::Normal(0.0),
|
||||||
)))
|
)))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ pub(super) fn get_test_bag(slots: u16) -> Item {
|
|||||||
ItemKind::Armor(armor::Armor::test_armor(
|
ItemKind::Armor(armor::Armor::test_armor(
|
||||||
ArmorKind::Bag("Test Bag".to_string()),
|
ArmorKind::Bag("Test Bag".to_string()),
|
||||||
Protection::Normal(0.0),
|
Protection::Normal(0.0),
|
||||||
|
Protection::Normal(0.0),
|
||||||
)),
|
)),
|
||||||
Quality::Common,
|
Quality::Common,
|
||||||
slots,
|
slots,
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.starter.glider' WHERE item_definition_id = 'common.items.glider.glider_cloverleaf';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.starter.lantern' WHERE item_definition_id = 'common.items.lantern.black_0';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.starter.rugged_chest' WHERE item_definition_id = 'common.items.armor.chest.rugged_chest';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.starter.rugged_pants' WHERE item_definition_id = 'common.items.armor.pants.rugged_pants';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.starter.sandals_0' WHERE item_definition_id = 'common.items.armor.foot.sandals_0';
|
10
server/src/migrations/2021-01-25-202618_starter_gear/up.sql
Normal file
10
server/src/migrations/2021-01-25-202618_starter_gear/up.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.glider.glider_cloverleaf' WHERE item_definition_id = 'common.items.armor.starter.glider';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.lantern.black_0' WHERE item_definition_id = 'common.items.armor.starter.lantern';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.chest.rugged_chest' WHERE item_definition_id = 'common.items.armor.starter.rugged_chest';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.pants.rugged_pants' WHERE item_definition_id = 'common.items.armor.starter.rugged_pants';
|
||||||
|
UPDATE item
|
||||||
|
SET item_definition_id = 'common.items.armor.foot.sandals_0' WHERE item_definition_id = 'common.items.armor.starter.sandals_0';
|
Loading…
x
Reference in New Issue
Block a user