Example #1
0
 public static void Duplicate(Spacemap map, out Spacemap duped)
 {
     duped = new Spacemap(map.Id, map.Name, map.Faction, map.Pvp, map.Starter, map.Level, map.Npcs,
                          map.PortalBase)
     {
         Disabled      = false,
         HashedObjects = map.HashedObjects,
         POIs          = map.POIs,
         Limits        = map.Limits,
         RangeDisabled = map.RangeDisabled,
         Objects       = map.Objects
     };
 }
Example #2
0
 //Configurations can be null because npcs will use this class too
 public Hangar(Ship ship, List <Drone> drones, Vector position, Spacemap spacemap, int hp, int nano, Dictionary <string, Item> items, bool active = true, Configuration[] configurations = null)
 {
     Ship           = ship;
     ShipDesign     = Ship;
     Drones         = drones;
     Position       = position;
     Spacemap       = spacemap;
     Health         = hp;
     Nanohull       = nano;
     Items          = items;
     Active         = active;
     Configurations = configurations;
 }
Example #3
0
        public static Vector Random(Spacemap map, int minX = 0, int maxX = 0, int minY = 0, int maxY = 0)
        {
            if (minX == 0)
            {
                minX = map.Limits[0].X;
            }
            if (minY == 0)
            {
                minY = map.Limits[0].Y;
            }
            if (maxX == 0)
            {
                maxX = map.Limits[1].X;
            }
            if (maxY == 0)
            {
                maxY = map.Limits[1].Y;
            }

            var posX = Utils.Random.Next(minX, maxX);
            var posY = Utils.Random.Next(minY, maxY);

            return(new Vector(posX, posY));
        }
Example #4
0
        protected Character(int id, string name, Hangar hangar, Faction factionId, Vector position, Spacemap spacemap,
                            Reward rewards, Clan clan = null) : base(id)
        {
            Name      = name;
            Hangar    = hangar;
            FactionId = factionId;
            Position  = position;
            Spacemap  = spacemap;
            Reward    = rewards;
            Clan      = clan;

            //Default initialization
            Moving            = false;
            OldPosition       = new Vector(0, 0);
            Destination       = position;
            Direction         = new Vector(0, 0);
            MovementStartTime = new DateTime();
            MovementTime      = 0;

            RenderRange = 2000;
            Range       = new Range {
                Character = this
            };

            Skills    = new Skilltree(this);
            Updaters  = new Updaters(this);
            Cooldowns = new CooldownsAssembly(this);

            LastCombatTime = DateTime.Now;
            if (clan == null)
            {
                Clan = Global.StorageManager.Clans[0];
            }

            Ticked += AssembleTick;
        }
Example #5
0
 public Npc(int id, string name, Hangar hangar, Faction factionId, Vector position, Spacemap spacemap, int currentHealth, int currentNanoHull, Reward rewards,
            int maxShield, int damage, int respawnTime = 0, bool respawning = true, Npc motherShip = null)
     : base(id, name, hangar, factionId, position, spacemap, rewards)
 {
     CurrentHealth    = currentHealth;
     CurrentNanoHull  = currentNanoHull;
     Damage           = damage;
     CurrentShield    = maxShield;
     MaxShield        = maxShield;
     ShieldAbsorption = 0.5;
     MotherShip       = motherShip;
     RespawnTime      = respawnTime;
     Respawning       = respawning;
 }