public void OnMouseAction(MouseActionEventArgs mouse) { switch (mouse.Action) { case MouseAction.Released: if (Map.ActiveMode == ShipDesignerMap.Mode.Build) { switch (mouse.Button) { case MouseButton.Left: Ship.AddModule(SelectedModule, GridPosition, Map.ModuleRotation); break; case MouseButton.Right: Ship.RemoveModule(GridPosition); break; case MouseButton.Middle: BattleModule module = Ship.GetModuleAt(GridPosition); if (module != null) { SelectedModule = module.Data; } Map.ModuleRotation++; break; } } break; } }
public virtual bool IsActionLimited(SkillObj self, ActionLimitType limit, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { if (!CommonCheck(self, skillInfo, skillConfig)) { return(false); } var logicState = BattleModule.GetSkillLogicState(skillInfo, self); if (logicState == null) { return(false); } var ret = logicState.IsActionLimited(self, limit, skillInfo, skillConfig); return(ret); }
public InternalModules(InternalAccessors accessors, InternalAdditionalLogics additionalLogics, LogicData data, IServerAPI api) { AchievementModule = AchievementModule.CreateClient(accessors.AchievementAccessor, additionalLogics.ScorersLogic, additionalLogics.DropLogic, accessors.FormulaController, additionalLogics.ImpactController); ActivationModule = ActivationModule.CreateClient(accessors.FormulaController, additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, accessors.PlayerAccessor, accessors.UnitsAccessor, additionalLogics.ApplyChangeLogic); AutowinModule = AutowinModule.CreateClient(additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, additionalLogics.FormulaLogic, additionalLogics.ExplorerLogic); BattleModule = BattleModule.CreateClient(accessors.BattleAccessor, accessors.ExplorerAccessor, accessors.UnitsAccessor, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.TriggerLogic, additionalLogics.BattleLogic, additionalLogics.BuffLogic); CheatModule = CheatModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, additionalLogics.ExplorerLogic, additionalLogics.BattleLogic, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.DropLogic, additionalLogics.ScorersLogic); CutSceneModule = CutSceneModule.CreateClient(accessors.CutSceneAccessor, additionalLogics.ImpactController, additionalLogics.ApplyChangeLogic); EquipmentModule = EquipmentModule.CreateClient(accessors.InventoryAccessor, accessors.ScorersAccessor, accessors.UnitsAccessor, additionalLogics.ImpactController, additionalLogics.FormulaLogic); ExplorerProgressModule = ExplorerProgressModule.CreateClient(accessors.ExplorerAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.SettingsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.ExplorerLogic, additionalLogics.FormulaLogic, additionalLogics.ImpactController); GachaModule = GachaModule.CreateClient(additionalLogics.ImpactController, accessors.ScorersAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.ExplorerAccessor, additionalLogics.DropLogic, accessors.ConditionController, additionalLogics.FormulaLogic); SettingsModule = SettingsModule.CreateClient(accessors.SettingsAccessor, accessors.ScorersAccessor, additionalLogics.ImpactController); ShopModule = ShopModule.CreateClient(accessors.ScorersAccessor, accessors.ShopAccessor, additionalLogics.FormulaLogic, additionalLogics.ImpactController, additionalLogics.ShopLogic, additionalLogics.DropLogic); StartSessionModule = StartSessionModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, accessors.ShopAccessor, accessors.LogAccessor, accessors.AchievementAccessor, additionalLogics.BattleLogic, additionalLogics.ShopLogic, additionalLogics.ExplorerLogic, accessors.FormulaController, additionalLogics.ImpactController); StorageModule = StorageModule.CreateClient(accessors.ScorersAccessor, accessors.InventoryAccessor); UnitProgressModule = UnitProgressModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.FormulaLogic, accessors.PlayerAccessor, additionalLogics.ImpactController); }
public virtual double DataFix(SkillObj self, PropertyType pType, double pValue, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { if (!CommonCheck(self, skillInfo, skillConfig)) { return(pValue); } var logicState = BattleModule.GetSkillLogicState(skillInfo, self); if (logicState == null) { return(pValue); } if (logicState.NeedDataFix(self, pType, pValue, skillInfo, skillConfig)) { pValue = OnDataFix(self, pType, pValue, skillInfo, skillConfig); } return(pValue); }
public virtual bool InitSkillInfo(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { var guid = BattleModule.BattleID; //var time = self.GetSkillTime(skillConfig); var skillId = self.GetSkillID(skillConfig); //var nowTime = self.GetNowTime(); //var activeNum = self.GetActiveNum(skillConfig); self.SetSkillId(skillInfo, skillId); //self.SetSkillTime(skillInfo, time); self.SetSkillGuid(skillInfo, guid); //self.SetSkillStateTime(skillInfo, nowTime); //self.SetSkillSrcObj(skillInfo, self); //self.SetActiveNum(skillInfo, activeNum); self.SetSkillStateIndex(skillInfo, 0); var startLogicStateName = self.GetLogicState(skillConfig, 0); var startLogicState = BattleModule.GetSkillLogicState(startLogicStateName); if (startLogicState == null) { self.LogInfo("startLogicState == null skillId:[{0}] startLogicStateName:[{1}]".F(skillId, startLogicStateName)); return(false); } //init startLogicState.InitSkill(self, skillInfo, skillConfig, 0); startLogicState.InitState(self, skillInfo, skillConfig, 0); var targetSelectName = self.GetTargetSelect(skillConfig); var targetSelect = BattleModule.GetTargetSelect(targetSelectName); if (targetSelect == null) { self.LogInfo("targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(skillId, targetSelectName)); return(false); } targetSelect.Init(self, skillInfo, skillConfig); return(true); }
public ModuleSaveData(BattleModule module) { DataID = module.Data.ID; GridPosition = module.GridPosition; Rotation = module.Rotation; }
public virtual void Tick(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig) { if (!CommonCheck(self, skillInfo, skillConfig)) { return; } var logicState = BattleModule.GetSkillLogicState(skillInfo, self); if (logicState == null) { return; } var ret = logicState.Tick(self, skillInfo, skillConfig); switch (ret) { case LogicStateTickRet.TimeFinish: SkillOnEnd(self, skillInfo, skillConfig); break; case LogicStateTickRet.NextState: int index = self.GetSkillStateIndex(skillInfo); string nextStateName = self.GetLogicState(skillConfig, ++index); if (nextStateName == null || nextStateName.Equals("")) { SkillOnEnd(self, skillInfo, skillConfig); return; } var nextLogicState = BattleModule.GetSkillLogicState(nextStateName); if (nextLogicState == null) { self.LogInfo("startLogicState {0} not found".F(nextStateName)); return; } double fixTime = logicState.OnStateChanged(nextStateName, self, skillInfo, skillConfig); self.SetSkillStateIndex(skillInfo, index); nextLogicState.InitState(self, skillInfo, skillConfig, fixTime); self.NotifySkillInfo(skillInfo, BattleInfoNotifyType.ChangeState_Skill, BattleNotifyTime.TickEnd); break; case LogicStateTickRet.OnEffect: //var srcObj = self.GetSkillSrcObj(skillInfo); { var targetSelectName = self.GetTargetSelect(skillConfig); var targetSelect = BattleModule.GetTargetSelect(targetSelectName); if (targetSelect == null) { self.LogInfo("targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(self.GetSkillID(skillInfo), targetSelectName)); return; } var targetTypeName = self.GetTargetType(skillConfig); var targetType = BattleModule.GetTargetType(targetTypeName); if (targetType == null) { self.LogInfo("targetSelect == null skillId:[{0}] targetType:[{1}]".F(self.GetSkillID(skillInfo), targetTypeName)); return; } var targets = BattleModule.GetTargets(self, targetSelect, targetType, skillInfo, skillConfig); foreach (var tar in targets) { OnEffect(self, tar, skillInfo, skillConfig); } } break; } }