예제 #1
0
    public int bombx, bomby; //sloppy- should use mob instead

    public item_instance(Etilesprite _tile, bool _ismob = false, mob m = null, int _bombcount = 0)
    {
        tile      = _tile;
        ismob     = _ismob;
        mob       = m;
        bombcount = _bombcount;
    }
예제 #2
0
 public Tcityaddons(string _e, string _n, int _cost, Etilesprite _tile)
 {
     explain = _e;
     name    = _n;
     cost    = _cost;
     tile    = _tile;
 }
예제 #3
0
 public Tresource(Eresourcetype _ert, string _name, int _p, int _g, int _f, string _exploit, Etilesprite _tile, string _explain, bool destroyed)
 {
     ert                 = _ert;
     yieldwhenworked     = new yields(_p, _g, _f);
     name                = _name;
     nameofexploiter     = _exploit;
     tile                = _tile;
     explain             = _explain;
     destroyedbybuilding = destroyed;
 }
    public bool check3(Etilesprite e, Etilesprite x)
    {
        //returns true if e matches x
        //check if supplied tile e is of type x, i.e. is the same or in the same 3 set
        //because there are 3 tiles for the biomes
        //this is just to neaten the code. speed is not an issue.

        int a = (int)e;
        int b = (int)x;

        return(a == b || a == b + 1 || a == b + 2);
    }
    public void do_fov_rec_shadowcast(int x, int y, int radius)
    {
        FOV_set_this_run.Fill(false);
        in_FOV.Fill(false);

        Action <int, int> ff = (int xx, int yy) =>
        {
            in_FOV.AtSet(xx, yy, true);
            fogofwar.AtSet(xx, yy, false);
            Etilesprite et = displaychar.AtGet(xx, yy);
            //new debug
            if ((int)et < 0 || (int)et > 255)
            {
                Debug.Log("ET OUT OF BOUNDS =" + (int)et);
            }
            //end new debug
            playermemory.AtSet(xx, yy, et);

            if (itemgrid[xx, yy] != null && itemgrid[xx, yy].ismob == false)
            {
                minimap.SetPixel(xx, yy, (Color)minimapcolours[(int)itemgrid[xx, yy].tile]);
            }
            else
            {
                if (buildings[xx, yy] != Etilesprite.EMPTY)
                {
                    minimap.SetPixel(xx, yy, (Color)minimapcolours[(int)buildings[xx, yy]]);
                }
                else
                {
                    minimap.SetPixel(xx, yy, (Color)minimapcolours[(int)et]);
                }
            }
            //if (et == Etilesprite.WALL) minimap.SetPixel(xx, yy, Color.grey);
            //else if (et == Etilesprite.FLOOR) minimap.SetPixel(xx, yy, Color.black);
        };

        for (sbyte i = 0; i < 8; i++)
        {
            cast_light(x, y, radius, 1, 1.0f, 0.0f, multipliers[0, i],
                       multipliers[1, i], multipliers[2, i], multipliers[3, i],
                       ff
                       );
        }
        ff(x, y);

        minimap.SetPixel(this.player.posx, this.player.posy, Color.magenta);
        minimap.Apply(false);
    }
예제 #6
0
    public mob(Emobtype typ)
    {
        AIformob = new AI();
        mobarchetype at = archetypes[(int)typ];

        archetype = at;
        hp        = at.hp;
        tile      = at.tile;
        hostile_toenemies_currently = at.hostile_toenemies;
        hostile_toplayer_currently  = at.hostile_toplayer;
        //undead_currently = at.undead;
        flies_currently  = at.flies;
        skates_currently = at.skates;

        facing = 0;
        speed  = 0;
    }
예제 #7
0
    public mobarchetype(Emobtype _type, string _name, string _wep, int _hp, bool _hostileplayer, bool _hostileenemy, Etilesprite _tile,
                        int _upkeepgold, int _upkeepfood, int _buildprod, int _buildhorse, int _buildiron,
                        int _al, int _ah, int _def, int _sr, bool _tank, bool _parry, int _moves, int _attacks)
    {
        type                = _type;
        name                = _name; weaponname = _wep; hp = _hp; tile = _tile; hostile_toplayer = _hostileplayer; hostile_toenemies = _hostileenemy;
        upkeepgold          = _upkeepgold;
        upkeepfood          = _upkeepfood;
        buildcostproduction = _buildprod;
        buildcostiron       = _buildiron;
        buildcosthorses     = _buildhorse;

        attacklow   = _al;
        attackhigh  = _ah;
        defence     = _def;
        sightradius = _sr;
        tank        = _tank;
        parry       = _parry;
        moves       = _moves;
        attacks     = _attacks;
    }