Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
11 kB
1
Indexable
Never
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Colors }
using { /Verse.org/Verse }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Fortnite.com/UI }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/UI }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags }

spawners := class(tag){}

zone_manager_device := class(creative_device):
    var CurrentMoney<public> : float = 0.0
    var MoneyInc<public> : float = 0.0
    var MoneyDec<public> : float = 0.0
    var MoneyWidget:text_block = text_block{DefaultTextColor := color{R:= 255.0, G:= 255.0, B:=255.0}}
    var MoneyIncWidget:text_block = text_block{DefaultTextColor := color{R:= 1.0, G:= 255.0, B:=1.0}}
    var MoneyDecWidget:text_block = text_block{DefaultTextColor := color{R:= 255.0, G:= 1.0, B:=1.0}}

    var AutoFarmUnlock : logic = false

    @editable Zone1 : prop_manipulator_device = prop_manipulator_device{}
    @editable Zone2 : []prop_manipulator_device = array{}
    @editable Zone3 : []prop_manipulator_device = array{}
    @editable Zone4 : []prop_manipulator_device = array{}
    @editable Zone5 : []prop_manipulator_device = array{}
    @editable Zone6 : []prop_manipulator_device = array{}
    @editable Zone7 : []prop_manipulator_device = array{}
    @editable Zone8 : []prop_manipulator_device = array{}
    @editable Zone9 : []prop_manipulator_device = array{}
    @editable Zone10 : []prop_manipulator_device = array{}
    @editable Zone11 : []prop_manipulator_device = array{}
    @editable Zone12 : []prop_manipulator_device = array{}
    @editable Zone13 : []prop_manipulator_device = array{}
    @editable Zone14 : []prop_manipulator_device = array{}
    @editable Zone15 : []prop_manipulator_device = array{}
    @editable Zone16 : []prop_manipulator_device = array{}
    @editable Zone17 : []prop_manipulator_device = array{}
    @editable Zone18 : []prop_manipulator_device = array{}
    @editable Zone19 : []prop_manipulator_device = array{}
    @editable Zone20 : []prop_manipulator_device = array{}
   
    @editable ZoneTrigger1 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger2 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger3 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger4 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger5 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger6 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger7 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger8 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger9 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger10 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger11 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger12 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger13 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger14 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger15 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger16 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger17 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger18 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger19 : mutator_zone_device = mutator_zone_device{}
    @editable ZoneTrigger20 : mutator_zone_device = mutator_zone_device{}

    @editable PropTrigger1 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger2 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger3 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger4 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger5 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger6 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger7 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger8 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger9 : mutator_zone_device = mutator_zone_device{}
    @editable PropTrigger10 : mutator_zone_device = mutator_zone_device{}
    
    @editable Prop1 : []prop_manipulator_device = array{}
    @editable Prop2 : []prop_manipulator_device = array{}
    @editable Prop3 : []prop_manipulator_device = array{}
    @editable Prop4 : []prop_manipulator_device = array{}
    @editable Prop5 : []prop_manipulator_device = array{}
    @editable Prop6 : []prop_manipulator_device = array{}
    @editable Prop7 : []prop_manipulator_device = array{}
    @editable Prop8 : []prop_manipulator_device = array{}
    @editable Prop9 : []prop_manipulator_device = array{}
    @editable Prop10 : []prop_manipulator_device = array{}

    @editable MoneyBox1 : prop_manipulator_device = prop_manipulator_device{}
    @editable MoneyBox2 : prop_manipulator_device = prop_manipulator_device{}
    @editable MoneyBox3 : prop_manipulator_device = prop_manipulator_device{}
    @editable MoneyBox4 : prop_manipulator_device = prop_manipulator_device{}
    @editable MoneyBox5 : prop_manipulator_device = prop_manipulator_device{}

    @editable AutoFarmTrigger1 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger2 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger3 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger4 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger5 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger6 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger7 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger8 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger9 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger10 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger11 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger12 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger13 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger14 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger15 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger16 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger17 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger18 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger19 : mutator_zone_device = mutator_zone_device{}
    @editable AutoFarmTrigger20 : mutator_zone_device = mutator_zone_device{}

    

    OnBegin<override>()<suspends>:void=
        Spawners := GetCreativeObjectsWithTag(spawners{})
                    for (Obj : Spawners):
                        if(PlayerSpawners := player_spawner_device[Obj]):
                            PlayerSpawners.SpawnedEvent.Subscribe(AddUIToPlayer)
        ZoneTrigger1.AgentEntersEvent.Subscribe(UnlockFirstZone)
        MoneyBox1.DamagedEvent.Subscribe(AddOneDollar)
    
        # ARRAY
        for(X : Prop1):
            X.ShowProps()

        loop:
            Sleep(1.5)
            set MoneyInc = 0.0
            set MoneyDec = 0.0
            UpdateUIMoneyInc()
            UpdateUIMoneyDec()
        AutoFarm1()

    AutoFarm1()<suspends>:void=
        if(AutoFarmUnlock?){
            loop:
                Sleep(1.0)
                set CurrentMoney += 1.0
                set MoneyInc += 1.0
                UpdateUIMoneyInc()
                UpdateUIMoney()
        }


    UnlockFirstZone(Agent:agent):void=
        if(CurrentMoney >= 5.0){
            set CurrentMoney -= 5.0
            set MoneyDec += 5.0
            Zone1.ShowProps()
            UpdateUIMoneyDec()
            UpdateUIMoney()
        }
    AddOneDollar(Agent:agent):void=
        set CurrentMoney += 1.0
        set MoneyInc += 1.0
        UpdateUIMoneyInc()
        UpdateUIMoney()

    CreateMoneyUI() : canvas =
        UpdateUIMoney()
        userInterface : canvas = canvas:
            Slots := array:
                canvas_slot:
                    Anchors := anchors{Minimum := vector2{X:= 0.0, Y:= 0.5}, Maximum := vector2{X:= 0.0, Y:=0.5}}
                    Offsets := margin{Top := 0.0, Left:= 100.0, Right := 0.0, Bottom:= 250.0}
                    Alignment := vector2{X:=0.0, Y:=1.0}
                    SizeToContent:=false
                    Widget := MoneyWidget
        return userInterface

    CreateMoneyIncUI() : canvas =
        UpdateUIMoneyInc()
        userInterface : canvas = canvas:
            Slots := array:
                canvas_slot:
                    Anchors := anchors{Minimum := vector2{X:= 0.0, Y:= 0.5}, Maximum := vector2{X:= 0.0, Y:=0.5}}
                    Offsets := margin{Top := 0.0, Left:= 98.0, Right := 0.0, Bottom:= 278.0}
                    Alignment := vector2{X:=0.0, Y:=1.0}
                    SizeToContent:=false
                    Widget := MoneyIncWidget
        return userInterface

    CreateMoneyDecUI() : canvas =
        UpdateUIMoneyDec()
        userInterface : canvas = canvas:
            Slots := array:
                canvas_slot:
                    Anchors := anchors{Minimum := vector2{X:= 0.0, Y:= 0.5}, Maximum := vector2{X:= 0.0, Y:=0.5}}
                    Offsets := margin{Top := 0.0, Left:= 102.0, Right := 0.0, Bottom:= 222.0}
                    Alignment := vector2{X:=0.0, Y:=1.0}
                    SizeToContent:=false
                    Widget := MoneyDecWidget
        return userInterface
    
    AddUIToPlayer(Agent:agent):void=
        if(Player := player[Agent]):
            if(PlayerUI := GetPlayerUI[Player]):
                PlayerUI.AddWidget(CreateMoneyUI())              
                PlayerUI.AddWidget(CreateMoneyIncUI())
                PlayerUI.AddWidget(CreateMoneyDecUI())
        
    UpdateUIMoney() : void = 
            MoneyWidget.SetText(GetCurrentMoneyText(CurrentMoney)) 

    UpdateUIMoneyInc() : void =
            if(MoneyInc > 0.0):
                MoneyIncWidget.SetText(GetAddedMoneyText(MoneyInc))
            if(MoneyInc = 0.0):
                MoneyIncWidget.SetText(GetNullMoneyInc(MoneyInc))
    
    UpdateUIMoneyDec():void=
        if(MoneyDec > 0.0):
            MoneyDecWidget.SetText(GetRemovedMoneyText(MoneyDec))
        if(MoneyDec = 0.0):
            MoneyDecWidget.SetText(GetNullMoneyInc(MoneyDec))

    GetCurrentMoneyText<localizes>(MoneyValue: float) : message = "${MoneyValue}"
    GetAddedMoneyText<localizes>(MoneyUPValue: float) : message = "+${MoneyUPValue}"
    GetRemovedMoneyText<localizes>(MoneyDownValue: float) : message = "-${MoneyDownValue}"
    GetNullMoneyInc<localizes>(NullUPValue: float) : message = " "