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