Esempio n. 1
0
    public static bool Activate(IActivator activator, IActivatable activatable, Dictionary <object, object> argumentDictionary = null)
    {
        bool capable = (int)activator.GetHealthState() >= (int)HealthState.Capable;

        if (capable && activatable != null)
        {
            activatable.BecomeActivated(activator, argumentDictionary);
        }
        return(capable);
    }
Esempio n. 2
0
    public bool BecomeActivated(IActivator activator, Dictionary <object, object> argumentDictionary = null)
    {
        bool clickActivate   = (bool)argumentDictionary["MBD"] && firingMode == FiringMode.Manual;
        bool holdActivate    = (bool)argumentDictionary["MB"] && (firingMode == FiringMode.Automatic || firingMode == FiringMode.Burst);
        bool controlActivate = clickActivate || holdActivate;

        bool didActivate = false;

        if (controlActivate && magazineCount > 0)
        {
            didActivate = activatable.BecomeActivated(activator, argumentDictionary);
            if (didActivate)
            {
                magazineCount--;
            }
        }
        return(didActivate);
    }
Esempio n. 3
0
 public bool BecomeActivated(IActivator activator, Dictionary <object, object> argumentDictionary = null)
 {
     return(activatable.BecomeActivated(activator, argumentDictionary));
 }