コード例 #1
0
ファイル: BuildingObject.cs プロジェクト: IronArthur/MCUnity
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType);
            //-------------------------------------------
            // Initialize the Building Appearance here.

            //setExists(true);
            //setFlag(OBJECT_FLAG_JUSTCREATED, true);

            captureTime = -1000.0f;

            var buildingAppearanceType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

            appearance = new BuildingAppearance(buildingAppearanceType, this);

            objectClass = ObjectClass.BUILDING;
            //setFlag(OBJECT_FLAG_DAMAGED, true);

            BuildingType type = (BuildingType)objType;

            if (type.extentRadius > 0.0)
            {
            }
            //setTangible(true);

            tonnage    = type.baseTonnage;
            explDamage = type.explDmg;
            explRadius = type.explRad;

            curCV = maxCV = (short)type.startBR;

            //setFlag(OBJECT_FLAG_CANREFIT, type->canRefit);
            //setFlag(OBJECT_FLAG_MECHBAY, type->mechBay);

            //setTeamId(type.teamId, true);

            //if (type.sensorRange > -1.0 && getTeam())
            //    setSensorData(getTeam(), type->sensorRange, true);

            //setFlag(OBJECT_FLAG_CAPTURABLE, false);
            if (type.capturable)
            {
                //setFlag(OBJECT_FLAG_CAPTURABLE, true);

                //setRefitBuddy(0);

                if (type.DamageLevel == 0.0f)
                {
                    //-------------------------------------------------------
                    // We are already destroyed. Used for extraction markers.
                    //setTangible(false);
                    //setStatus(OBJECT_STATUS_DESTROYED);
                    //setFlag(OBJECT_FLAG_DAMAGED, true);
                }
            }
        }
コード例 #2
0
ファイル: GateObject.cs プロジェクト: IronArthur/MCUnity
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType, appearanceTypeManager);

            objectClass = ObjectClass.GATE;

            var buildingAppearanceType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

            appearance = new GVAppearance(buildingAppearanceType, this);
        }
コード例 #3
0
        //static bool turretsEnabled[MAX_TEAMS];

        #endregion

        #region Class Structures
        #endregion

        #region Constructors
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType);
            readyTime           = new float[MAX_TURRET_WEAPONS];
            lastFireTime        = new float[MAX_TURRET_WEAPONS];
            numWeaponFireChunks = new long[2];
            weaponFireChunks    = new ulong[2][];
            weaponFireChunks[0] = new ulong[MAX_TURRET_WEAPONFIRE_CHUNKS];
            weaponFireChunks[1] = new ulong[MAX_TURRET_WEAPONFIRE_CHUNKS];

            //-------------------------------------------
            // Initialize the Building Appearance here.
            //GameObject::init(true, _type);

            //setFlag(OBJECT_FLAG_JUSTCREATED, true);

            var turretAppearanceType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

            appearance = new GVAppearance(turretAppearanceType, this);

            objectClass = ObjectClass.TURRET;
            //setFlag(OBJECT_FLAG_DAMAGED, true);



            teamId       = -1;
            readyTime[0] = readyTime[1] = readyTime[2] = readyTime[3] = 0f;

            TurretType type = (TurretType)objType;

            if (type.engageRadius != 0.0)
            {
                type.extentRadius = (type.engageRadius);
            }

            if (type.extentRadius > 0.0)
            {
            }
            //setFlag(OBJECT_FLAG_TANGIBLE, true);

            tonnage    = type.baseTonnage;
            explDamage = type.explDmg;
            explRadius = type.explRad;

            //setFlag(OBJECT_FLAG_CAPTURABLE, false);

            //setFlag(OBJECT_FLAG_POP_NEUTRALS, false);
        }
コード例 #4
0
ファイル: TerrainObject.cs プロジェクト: IronArthur/MCUnity
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType);
            if (((TerrainObjectType)objType).subType == (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_TREE)
            {
                var treeAppearType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

                appearance = new TreeAppearance(treeAppearType, this);
            }
            else
            {
                var terrainObjectAppearType = appearanceTypeManager.GetAppearanceType(objType.Appearance);
                appearance = new BuildingAppearance(terrainObjectAppearType, this);
            }


            this.objectClass = ObjectClass.TERRAINOBJECT;

            switch (((TerrainObjectType)objType).subType)
            {
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_NONE:
                if (((TerrainObjectType)objType).DamageLevel == 0f)
                {
                    //--------------------------------------------------------
                    // We are already destroyed.  Used for extraction Markers
                    //setTangible(false);
                    //setStatus(OBJECT_STATUS_DESTROYED);
                }
                break;

            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_TREE:
                objectClass = ObjectClass.TREE;
                //setFlag(OBJECT_FLAG_DAMAGED, false);
                break;

            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_BRIDGE:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_FOREST:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_HEAVY:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_MEDIUM:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_LIGHT:
                //setTangible(false);
                objectClass = ObjectClass.BRIDGE;
                break;
            }
        }