Ejemplo n.º 1
0
    void OnReqPick(NetworkMessage msg)
    {
        Log.i("LanHost OnReqPick", Log.Tag.Net);
        MsgPick   m = msg.ReadMessage <MsgPick> ();
        DropItems u = mUnitMgr.getUnit(m.dropGuid) as DropItems;

        u.decState(UnitState.Alive | UnitState.Exist);
        WindowMgr.SendWindowMessage("MainWindow", "ShowDrop", u.tid);
    }
Ejemplo n.º 2
0
    bool isSinking; //diz se está afundando no chão


    void Awake()
    {
        anim            = GetComponent <Animator> ();
        enemyAudio      = GetComponent <AudioSource> ();
        hitParticles    = GetComponentInChildren <ParticleSystem> (); //busca neste objeto ou em seus filhos o primeiro componente ParticleSystem que encontrar
        capsuleCollider = GetComponent <CapsuleCollider> ();
        dropItems       = GetComponent <DropItems> ();

        currentHealth = startingHealth;
    }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     anim            = GetComponent <Animator>();
     rigidbody       = GetComponent <Rigidbody>();
     capsuleCollider = GetComponent <CapsuleCollider>();
     isAlive         = true;
     currentHealth   = startingHealth;
     audio           = GetComponent <AudioSource>();
     dropItems       = GetComponent <DropItems>();
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     rigidbody       = GetComponent <Rigidbody>();
     capsuleCollider = GetComponent <CapsuleCollider>();
     anim            = GetComponent <Animator>();
     isAlive         = true;
     currentHealth   = startingHealth;
     dropItems       = GetComponent <DropItems>();
     playerData      = player.GetComponent <PlayerData>();
 }
Ejemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        rigidbody       = GetComponent <Rigidbody>();
        capsuleCollider = GetComponent <CapsuleCollider>();
        anim            = GetComponent <Animator>();
        isAlive         = true;
        currentHealth   = startingHealth;
        dropItems       = GetComponent <DropItems>();

        dbConn = FindObjectOfType <DBConnection>();
    }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     rigidbody       = GetComponent <Rigidbody>();
     capsuleCollider = GetComponent <CapsuleCollider>();
     nav             = GetComponent <NavMeshAgent>();
     anim            = GetComponent <Animator>();
     isAlive         = true;
     currentHealth   = startingHealth;
     weaponCollider  = GetComponentInChildren <BoxCollider>();
     dropItems       = GetComponent <DropItems>();
     playerData      = player.GetComponent <PlayerData>();
 }
Ejemplo n.º 7
0
 private void CheckHealth()
 {
     if (currentHealth <= 0)
     {
         DropItems drop = GetComponent <DropItems>();
         if (drop != null)
         {
             drop.Drop();
         }
         Destroy(gameObject);
     }
 }
Ejemplo n.º 8
0
    void Start()
    {
        EnemyTypo e = GetComponent <EnemyTypo>();

        startingHealth  = e.health;
        id              = e.id;
        rigidbody       = GetComponent <Rigidbody>();
        capsuleCollider = GetComponent <CapsuleCollider>();
        animator        = GetComponent <Animator>();
        isAlive         = true;
        currrentHealth  = startingHealth;
        dropItems       = GetComponent <DropItems>();
    }
 /// <summary>
 /// called by PRO UIFramework when item is dropped onto pane
 /// </summary>
 /// <param name="dropInfo"></param>
 public override void OnDrop(DropInfo dropInfo)
 {
     DropItems.Clear();
     foreach (var item in dropInfo.Items)
     {
         if (System.IO.Path.GetExtension(item.Data as string) != ".xls")
         {
             DropItems.Add(item.Data as string);
         }
         item.Handled = true;
     }
     DropHandled = $@"Dropped {dropInfo.Items.Count} onto pane";
 }
Ejemplo n.º 10
0
        //public static TechType RepulsionKnifeID;

        public static void Patch()
        {
            RoseLogger.PatchStart(modName, "1.0.0");
            try
            {
                Atlas.Sprite obsidianKnifeIcon = null;
                obsidianKnifeIcon = ImageUtils.LoadSpriteFromFile($"./QMods/MoreKnives/Assets/ObsidianKnife.png");

                ObsidianKnifeID = TechTypeHandler.AddTechType("obsidianknife", "Obsidian Knife", "An enhanced knife that exudes a rapidly cooling magma, forming a sharp obsidian edge.");

                SpriteHandler.RegisterSprite(ObsidianKnifeID, obsidianKnifeIcon);

                KnifePrefab obsidianKnifePrefab = new KnifePrefab("obsidianknife", "WorldEntities/Tools/ObsidianKnife", ObsidianKnifeID);

                DropItems.PatchDropItems();

                var techDataObsidian = new TechData
                {
                    craftAmount = 1,
                    Ingredients = new List <Ingredient>()
                    {
                        new Ingredient(TechType.Knife, 1),
                        new Ingredient(DropItems.ObsidianFlakeID, 1),
                    },
                };

                CraftDataHandler.SetTechData(ObsidianKnifeID, techDataObsidian);

                CraftTreeHandler.AddCraftingNode(CraftTree.Type.Workbench, ObsidianKnifeID, new string[] { "Survival Knife", "obsidianknife" });

                CraftDataHandler.SetItemSize(ObsidianKnifeID, new Vector2int(1, 1));

                CraftDataHandler.SetEquipmentType(ObsidianKnifeID, EquipmentType.Hand);

                PrefabHandler.RegisterPrefab(obsidianKnifePrefab);

                var harmony = HarmonyInstance.Create("rose.moreknives.mod");
                harmony.PatchAll(Assembly.GetExecutingAssembly());


                RoseLogger.PatchComplete(modName);
            }

            catch (Exception ex)
            {
                RoseLogger.PatchFailed(modName, ex);
            }
        }
Ejemplo n.º 11
0
    void Start()
    {
        EnemyTypo e = GetComponent <EnemyTypo>();

        startingHealth = e.health;
        Debug.Log(e.health);
        id              = e.id;
        rigidbody       = GetComponent <Rigidbody>();
        capsuleCollider = GetComponent <CapsuleCollider>();
        nav             = GetComponent <NavMeshAgent>();
        animator        = GetComponent <Animator>();
        isAlive         = true;
        currrentHealth  = startingHealth;
        weaponCollider  = GetComponentInChildren <BoxCollider>();
        dropItems       = GetComponent <DropItems>();
    }
Ejemplo n.º 12
0
    public DropItems createDropItems(int tid, Vector3 pos, Vector3 dir, uint instanceID = 0)
    {
        DropItems u = mUnitMgr.getUnit(0, UnitType.Drop, tid) as DropItems;

        u.setParam(pos, dir, instanceID);

        MsgCreate reply = new MsgCreate();

        reply.agentId  = u.agentId;
        reply.guid     = u.guid;
        reply.pos      = u.pos;
        reply.dir      = u.dir;
        reply.state    = u.state;
        reply.tid      = u.tid;
        reply.unitType = u.type;
        sendToAll((short)MyMsgId.Create, reply);
        return(u);
    }
Ejemplo n.º 13
0
    void OnReqPick(NetworkMessage msg)
    {
        Log.i("LanHost OnReqPick", Log.Tag.Net);
        MsgPick   m      = msg.ReadMessage <MsgPick> ();
        DropItems u      = mUnitMgr.getUnit(m.dropGuid) as DropItems;
        Client    client = getClient(msg.conn);

        if (u != null)
        {
            if (!u.pick(client.playerGUID))
            {
                return;
            }
            Bag.Item it    = client.bag.addItem(u.tid, 1);
            MsgItem  reply = new MsgItem();
            reply.itemId = it.id;
            reply.count  = it.count;
            sendTo(msg.conn.connectionId, (short)MyMsgId.ItemChange, reply);
        }
    }
Ejemplo n.º 14
0
 protected override void onUnitDeinit()
 {
     if (mHeadInfo != null)
     {
         mHeadInfo.Unbind();
     }
     sendUnitEvent((int)UnitEvent.AIStop, null);
     mAnim.sendEvent(AnimPlugin.Die);
     if (isServer)
     {
         if (drops != null)
         {
             int itemId = drops[Random.Range(0, drops.Length)];
             if (Randoms.drop(itemId, 1))
             {
                 DropItems u = NetMgr.server.createDropItems(itemId, pos, Vector3.right, 0);
             }
         }
     }
     Invoke("recyle", 5f);
 }
Ejemplo n.º 15
0
        public void OnReceived()
        {
            if (Requester != null)
            {
                string requesterName = Requester.playerCharacterMasterController?.GetDisplayName() ?? "<null>";
                DropItems.Logger.LogDebug($"Received '{nameof(DropLastItemMessage)}' from '{requesterName}'.");

                if (Requester.inventory != null)
                {
                    DropItems.DropLastItem(Requester);
                }
                else
                {
                    DropItems.Logger.LogWarning($"Received '{nameof(DropLastItemMessage)}' but the given requester's inventory was null!");
                }
            }
            else
            {
                DropItems.Logger.LogWarning($"Received '{nameof(DropLastItemMessage)}' but the given requester was null!");
            }
        }
Ejemplo n.º 16
0
        public void ParseFormBinary(BinaryReader reader)
        {
            UserID = reader.ReadInt64();
            Gold   = reader.ReadInt32();
            MapID  = reader.ReadInt32();
            int DropItems_Len = reader.ReadInt32();

            while (DropItems_Len-- > 0)
            {
                PlayerItem DropItems_Temp = new PlayerItem();
                DropItems_Temp = new PlayerItem(); DropItems_Temp.ParseFormBinary(reader);
                DropItems.Add(DropItems_Temp);
            }
            int ConsumeItems_Len = reader.ReadInt32();

            while (ConsumeItems_Len-- > 0)
            {
                PlayerItem ConsumeItems_Temp = new PlayerItem();
                ConsumeItems_Temp = new PlayerItem(); ConsumeItems_Temp.ParseFormBinary(reader);
                ConsumeItems.Add(ConsumeItems_Temp);
            }
        }
Ejemplo n.º 17
0
    void createDropItems(MsgCreate m)
    {
        DropItems u = mUnitMgr.getUnit(m.guid, UnitType.Drop, m.tid) as DropItems;

        u.setParam(m.pos, m.dir);
    }