I’ve been trying to adapt a Mecha TableTop RPG into a Turn-based battling game. One feature is that, instead of a basic attack with the equipped weapon, the Mecha can select from one of it’s many weapons equipped and attack with it (if it’s melee, it adds it’s Power Stat to the weapon’s attack while if it’s ranged, it adds the Unit’s Force stat to the weapon’s attack).
The guns have Clips (or Magazines) which hold a limited number of shots. Most guns use one shot each attack but rapid fire guns fire more than one shot, which empties the same amount from the magazine (rapid fire weapons also have a -50% strength penalty to their Force Stat modifier). When the magazine is empty, the weapon cannot be fired until it is reloaded. To reload guns, the player needs to use a certain number of points from their “Ammo” or “Energy” statistic. Also, some energy weapons use energy directly from the unit’s energy stat.
I haven’t seen any scripts that handle a system like this, so are there any suggestions? My weapon script should be posted below if I did the format right.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Weapon
{
public string name;
public int attack;
public int clip;
public int bulletUse;
public int reloadAmmo;
public int reloadEnergy;
public int plugs;
public int durability;
public int recharge;
public enum Attribute { Conventional, Energy, Heat, Shock}
public enum Range { Melee, Ranged, Hybrid}
public enum Effect { Scatter, Pierce1, Pierce2, Missile, Drone}
public Weapon (string name, int attack, int clip, int bulletUse, int reloadAmmo, int reloadEnergy, int plugs, int durability, int recharge)
{
this.name = name;
this.attack = attack;
this.clip = clip;
this.bulletUse = bulletUse;
this.reloadAmmo = reloadAmmo;
this.reloadEnergy = reloadEnergy;
this.plugs = plugs;
this.durability = durability;
this.recharge = recharge;
}
}