コード例 #1
0
    public override void activate(ObjectActor self, ObjectCombatable target)
    {
        float num = target.getPercentHealth();

        if (num < 0.25f)
        {
            float damage = self.getStr() * 0.5f + 50.0f;
            target.takeSlashingDamage(damage, (ObjectInteractable)self);
        }
        else if (num < 0.5f)
        {
            float damage = self.getStr() * 0.5f + 30.0f;
            target.takeSlashingDamage(damage, (ObjectInteractable)self);
        }
    }
コード例 #2
0
ファイル: Execute.cs プロジェクト: ren38/Scripts
    public override bool activate(ObjectActor self, ObjectCombatable target, out string message)
    {
        float num = target.getPercentHealth();

        if (num < 0.25f)
        {
            float damage = self.getStr() * 0.5f + 50.0f;
            target.takeSlashingDamage(damage, (ObjectInteractable)self);
        }
        else if (num < 0.5f)
        {
            float damage = self.getStr() * 0.5f + 30.0f;
            target.takeSlashingDamage(damage, (ObjectInteractable)self);
        }
        else
        {
            message = "Target's health was not low enough.";
            return(true);
        }
        message = "";
        return(false);
    }