/**
 *      Main and only Gula mutator.
 *      Copyright 2022 Anton Tarasenko
 *------------------------------------------------------------------------------
 * This file is part of Gula.
 *
 * Gula is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License, or
 * (at your option) any later version.
 *
 * Gula is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Gula.  If not, see <https://www.gnu.org/licenses/>.
 */
class GulaMut extends Mutator;

//  Acedia's references to a `...Global` objects.
var private Global          _;
var private ClientGlobal    _client;

var int count;

simulated public function PostBeginPlay()
{
    if (level.netMode != NM_Client) {
        return;
    }
    _       = class'Global'.static.GetInstance();
    _client = class'ClientGlobal'.static.GetInstance();
}

simulated function DoItPussy()
{
    _client
        .unreal
        .GetLocalPlayer()
        .ClientMessage("Hey from Gula! Get fucking scammed, you idiot!");
}

simulated function Tick(float delta)
{
    count += 1;
    if (level.netMode != NM_Client) {
        return;
    }
    if (count % 30 == 0) {
        DoItPussy();
    }
}

defaultproperties
{
    GroupName       = "Graphic libaries"
    FriendlyName    = "Gula graphic library"
    Description     = "Graphics library for Acedia"
    bAddToServerPackages = true
    bAlwaysRelevant = true
    RemoteRole      = ROLE_SimulatedProxy
}