Exemplo n.º 1
0
 public OmniItemObject(OmniItemType item, int amount)
 {
     this.name = item.gameObject.name;
     this.stack = amount;
     id = OmniItems.getItem(name);
     //anim = OmniItems.itemAnim[id];
     type = item;
     bPos = new Vector3();
     r = new List<Rect>();
 }
Exemplo n.º 2
0
 public DamageEvent(int tick, OmniObject damaged, OmniObject attacker, OmniItemType itemType,Vector2 vel)
     : base(tick)
 {
     this.damaged = damaged;
     this.attacker = attacker;
     this.itemType = itemType;
     this.vel = vel;
     type = NetworkSendType.ServerCommandAll;
     if (Network.isServer)
         hp = new Vector2(damaged.HP, attacker.HP);
 }
Exemplo n.º 3
0
    public override void OnDamage(OmniObject damaged, OmniObject attacker, OmniItemType itemType, Vector2 vel)
    {
        Vector2 pos = damaged.Position;
        pos.x += damaged.item.Size / 2;
        pos.y += damaged.item.Size + 0.5f;

        int dmg = (int)(itemType.str * (vel.magnitude * 0.3f));

        if (damaged is PhysicsObject)
        {
            PhysicsObject p = (PhysicsObject)damaged;
            p.vel += vel;

            if (damaged == attacker) //fall damage
            {
                dmg = (int)p.vel.magnitude*2;
            }
        }
        OmniInventory.drawDamageGUI(dmg, pos, damaged);
        if (damaged is DamageableObject)
        {
            ((DamageableObject)damaged).Damage(attacker, dmg);
        }
    }
Exemplo n.º 4
0
 public virtual void OnDamage(OmniObject dmged, OmniObject attacker, OmniItemType itemType, Vector2 vel)
 {
 }
Exemplo n.º 5
0
 public void setItem(int itemid)
 {
     item = OmniItems.itemTypes[itemid];
     if (item == null)
         Debug.Log("ERR: " + id + " item null");
 }
Exemplo n.º 6
0
 public terrainDmg(OmniObject by, OmniItemType item,int x,int y)
     : base(by.id,x,y)
 {
     this.itemID = item.id;
 }
Exemplo n.º 7
0
 public static void hitTerrain(OmniObject player, OmniItemType item)
 {
 }