projectile fix3
This commit is contained in:
@@ -68,6 +68,7 @@ public class EditModel : AdminPageModel
|
|||||||
Item.IsTeleportScroll = Request.Form.ContainsKey("Item.IsTeleportScroll");
|
Item.IsTeleportScroll = Request.Form.ContainsKey("Item.IsTeleportScroll");
|
||||||
Item.RequiresAmmunition = Request.Form.ContainsKey("Item.RequiresAmmunition");
|
Item.RequiresAmmunition = Request.Form.ContainsKey("Item.RequiresAmmunition");
|
||||||
Item.IsThrowable = Request.Form.ContainsKey("Item.IsThrowable");
|
Item.IsThrowable = Request.Form.ContainsKey("Item.IsThrowable");
|
||||||
|
Item.IsLinearProjectile = Request.Form.ContainsKey("Item.IsLinearProjectile");
|
||||||
|
|
||||||
// Ensure nullable strings are never null
|
// Ensure nullable strings are never null
|
||||||
Item.Description ??= "";
|
Item.Description ??= "";
|
||||||
@@ -170,7 +171,20 @@ public class EditModel : AdminPageModel
|
|||||||
TintColor = Item.TintColor,
|
TintColor = Item.TintColor,
|
||||||
ResistancesJson = Item.ResistancesJson,
|
ResistancesJson = Item.ResistancesJson,
|
||||||
BuffResistancesJson = Item.BuffResistancesJson,
|
BuffResistancesJson = Item.BuffResistancesJson,
|
||||||
IsEnabled = Item.IsEnabled
|
IsEnabled = Item.IsEnabled,
|
||||||
|
// Projectile properties
|
||||||
|
RequiresAmmunition = Item.RequiresAmmunition,
|
||||||
|
AmmunitionType = Item.AmmunitionType,
|
||||||
|
ProjectileSpeed = Item.ProjectileSpeed,
|
||||||
|
ProjectileRange = Item.ProjectileRange,
|
||||||
|
ArrowRecoveryChance = Item.ArrowRecoveryChance,
|
||||||
|
QuiverCapacity = Item.QuiverCapacity,
|
||||||
|
IsThrowable = Item.IsThrowable,
|
||||||
|
IsLinearProjectile = Item.IsLinearProjectile,
|
||||||
|
ProjectileFrontX = Item.ProjectileFrontX,
|
||||||
|
ProjectileFrontY = Item.ProjectileFrontY,
|
||||||
|
ProjectileBackX = Item.ProjectileBackX,
|
||||||
|
ProjectileBackY = Item.ProjectileBackY
|
||||||
};
|
};
|
||||||
_db.DungeonItemDefinitions.Add(newItem);
|
_db.DungeonItemDefinitions.Add(newItem);
|
||||||
await _db.SaveChangesAsync();
|
await _db.SaveChangesAsync();
|
||||||
@@ -252,11 +266,19 @@ public class EditModel : AdminPageModel
|
|||||||
existing.ResistancesJson = Item.ResistancesJson;
|
existing.ResistancesJson = Item.ResistancesJson;
|
||||||
existing.BuffResistancesJson = Item.BuffResistancesJson;
|
existing.BuffResistancesJson = Item.BuffResistancesJson;
|
||||||
existing.IsEnabled = Item.IsEnabled;
|
existing.IsEnabled = Item.IsEnabled;
|
||||||
//Projectile
|
// Projectile properties
|
||||||
|
existing.RequiresAmmunition = Item.RequiresAmmunition;
|
||||||
|
existing.AmmunitionType = Item.AmmunitionType;
|
||||||
existing.ProjectileSpeed = Item.ProjectileSpeed;
|
existing.ProjectileSpeed = Item.ProjectileSpeed;
|
||||||
existing.ProjectileRange = Item.ProjectileRange;
|
existing.ProjectileRange = Item.ProjectileRange;
|
||||||
existing.ArrowRecoveryChance = Item.ArrowRecoveryChance;
|
existing.ArrowRecoveryChance = Item.ArrowRecoveryChance;
|
||||||
existing.QuiverCapacity = Item.QuiverCapacity;
|
existing.QuiverCapacity = Item.QuiverCapacity;
|
||||||
|
existing.IsThrowable = Item.IsThrowable;
|
||||||
|
existing.IsLinearProjectile = Item.IsLinearProjectile;
|
||||||
|
existing.ProjectileFrontX = Item.ProjectileFrontX;
|
||||||
|
existing.ProjectileFrontY = Item.ProjectileFrontY;
|
||||||
|
existing.ProjectileBackX = Item.ProjectileBackX;
|
||||||
|
existing.ProjectileBackY = Item.ProjectileBackY;
|
||||||
|
|
||||||
|
|
||||||
await _db.SaveChangesAsync();
|
await _db.SaveChangesAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user