public static ObjectMechanismObject CreateObjectMechanismObject(ObjectMechanismDefinition definition, int x, int y)
        {
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0082: Unknown result type (might be due to invalid IL or missing references)
            //IL_0083: Unknown result type (might be due to invalid IL or missing references)
            if (null == s_instance)
            {
                Log.Error("CreateObjectMechanismObject called while the factory is not ready.", 284, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                return(null);
            }
            if (!FightMap.current.TryGetCellObject(x, y, out CellObject cellObject))
            {
                Log.Error(string.Format("{0} called with an invalid position {1}, {2}.", "CreateObjectMechanismObject", x, y), 293, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightObjectFactory.cs");
                return(null);
            }
            Transform transform = cellObject.get_transform();
            Vector3   position  = transform.get_position();

            position.y += 0.5f;
            ObjectMechanismObject component = s_objectMechanismCharacterPool.Instantiate(position, Quaternion.get_identity(), transform).GetComponent <ObjectMechanismObject>();

            component.InitializeDefinitionAndArea(definition, x, y);
            component.SetCellObject(cellObject);
            return(component);
        }
        public static ObjectMechanismStatus Create(int id, [NotNull] ObjectMechanismDefinition definition, int level, PlayerStatus owner, Vector2Int position)
        {
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            int  id2            = owner.id;
            int  teamId         = owner.teamId;
            int  teamIndex      = owner.teamIndex;
            Area area           = definition.areaDefinition.ToArea(position);
            int  valueWithLevel = definition.baseMecaLife.GetValueWithLevel(level);
            ObjectMechanismStatus objectMechanismStatus = new ObjectMechanismStatus(id, id2, teamId, teamIndex, level);

            objectMechanismStatus.area       = area;
            objectMechanismStatus.definition = definition;
            objectMechanismStatus.SetCarac(CaracId.Life, valueWithLevel);
            return(objectMechanismStatus);
        }
Beispiel #3
0
        public static ITooltipDataProvider Create <T>(T definition, int level) where T : IDefinitionWithTooltip
        {
            SpellDefinition spellDefinition = definition as SpellDefinition;

            if (spellDefinition != null)
            {
                return(Create(spellDefinition, level));
            }
            CompanionDefinition companionDefinition = definition as CompanionDefinition;

            if (companionDefinition != null)
            {
                return(Create(companionDefinition, level));
            }
            SummoningDefinition summoningDefinition = definition as SummoningDefinition;

            if (summoningDefinition != null)
            {
                return(Create(summoningDefinition, level));
            }
            WeaponDefinition weaponDefinition = definition as WeaponDefinition;

            if (weaponDefinition != null)
            {
                return(Create(weaponDefinition, level));
            }
            FloorMechanismDefinition floorMechanismDefinition = definition as FloorMechanismDefinition;

            if (floorMechanismDefinition != null)
            {
                return(Create(floorMechanismDefinition, level));
            }
            ObjectMechanismDefinition objectMechanismDefinition = definition as ObjectMechanismDefinition;

            if (objectMechanismDefinition != null)
            {
                return(Create(objectMechanismDefinition, level));
            }
            ReserveDefinition reserveDefinition = definition as ReserveDefinition;

            if (reserveDefinition != null)
            {
                return(Create(reserveDefinition, level));
            }
            throw new ArgumentOutOfRangeException();
        }
Beispiel #4
0
        public static IEnumerator CreateObjectMechanismObject(FightStatus fightStatus, ObjectMechanismStatus objectMechanismStatus, PlayerStatus ownerStatus, int x, int y)
        {
            ObjectMechanismDefinition objectMechanismDefinition = (ObjectMechanismDefinition)objectMechanismStatus.definition;

            if (!(null == objectMechanismDefinition))
            {
                ObjectMechanismObject objectMechanismObject = FightObjectFactory.CreateObjectMechanismObject(objectMechanismDefinition, x, y);
                if (!(null == objectMechanismObject))
                {
                    objectMechanismStatus.view = objectMechanismObject;
                    objectMechanismObject.alliedWithLocalPlayer = (GameStatus.localPlayerTeamIndex == ownerStatus.teamIndex);
                    yield return(objectMechanismObject.LoadAnimationDefinitions(objectMechanismDefinition.defaultSkin.value));

                    objectMechanismObject.Initialize(fightStatus, ownerStatus, objectMechanismStatus);
                    yield return(objectMechanismObject.Spawn());
                }
            }
        }
Beispiel #5
0
 private static ITooltipDataProvider Create(ObjectMechanismDefinition mechanism, int level)
 {
     return(new ObjectMechanismTooltipDataProvider(mechanism, level));
 }
 public static string GetUICharacterResourcesBundleName(ObjectMechanismDefinition definition)
 {
     return("core/ui/characters/objectmechanisms");
 }