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
|
||||
- Lactose tolerant golems
|
||||
- 6 different gems. (Topaz, Amethyst, Sapphire, Emerald, Ruby and Diamond)
|
||||
- Poise system (not currently accessible to players for balancing reasons)
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -4,7 +4,10 @@ ItemDef(
|
||||
kind: Armor(
|
||||
(
|
||||
kind: Bag("TestBag18Slot"),
|
||||
stats: (protection: Normal(0.0)),
|
||||
stats: (
|
||||
protection: Normal(0.0),
|
||||
poise_protection: Normal(0.0),
|
||||
),
|
||||
)
|
||||
),
|
||||
quality: High,
|
||||
|
@ -4,7 +4,10 @@ ItemDef(
|
||||
kind: Armor(
|
||||
(
|
||||
kind: Bag("TestBag9Slot"),
|
||||
stats: (protection: Normal(0.0)),
|
||||
stats: (
|
||||
protection: Normal(0.0),
|
||||
poise_protection: Normal(0.0),
|
||||
),
|
||||
)
|
||||
),
|
||||
quality: High,
|
||||
|
@ -5,7 +5,9 @@ ItemDef(
|
||||
(
|
||||
kind: Foot("Dark"),
|
||||
stats: (
|
||||
protection: Normal(0.0)),
|
||||
protection: Normal(0.0),
|
||||
poise_protection: Normal(0.0),
|
||||
),
|
||||
)
|
||||
),
|
||||
quality: Low,
|
||||
|
@ -68,10 +68,17 @@ impl Armor {
|
||||
pub fn get_poise_protection(&self) -> Protection { self.stats.poise_protection }
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn test_armor(kind: ArmorKind, protection: Protection) -> Armor {
|
||||
pub fn test_armor(
|
||||
kind: ArmorKind,
|
||||
protection: Protection,
|
||||
poise_protection: Protection,
|
||||
) -> Armor {
|
||||
Armor {
|
||||
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(
|
||||
ArmorKind::Bag("test".to_string()),
|
||||
Protection::Normal(0.0),
|
||||
Protection::Normal(0.0),
|
||||
)))
|
||||
.unwrap();
|
||||
|
||||
@ -355,6 +356,7 @@ mod tests {
|
||||
.get_slot_to_equip_into(&ItemKind::Armor(Armor::test_armor(
|
||||
ArmorKind::Bag("test".to_string()),
|
||||
Protection::Normal(0.0),
|
||||
Protection::Normal(0.0),
|
||||
)))
|
||||
.unwrap();
|
||||
|
||||
|
@ -15,6 +15,7 @@ pub(super) fn get_test_bag(slots: u16) -> Item {
|
||||
ItemKind::Armor(armor::Armor::test_armor(
|
||||
ArmorKind::Bag("Test Bag".to_string()),
|
||||
Protection::Normal(0.0),
|
||||
Protection::Normal(0.0),
|
||||
)),
|
||||
Quality::Common,
|
||||
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…
Reference in New Issue
Block a user