/// <summary> /// Tag对象注册事件 /// </summary> /// <param name="group">TagGroup对象</param> /// <param name="tag">Tag对象</param> private void OnTagRegister(CustomGroup group, CustomTag tag) { _log.Trace($"Device[{Name}]:Tag[{tag.Name}],Offset[{tag.DB_Offset}]"); if (!(tag is SiemensTag)) { throw new Exception($"tag对象:{tag.Name}不是SiemensTag对象"); } SiemensTag siemensTag = tag as SiemensTag; switch (CycleReadMode) { case SiemensCycleReadMode.FullBlock: FullBlock.Add(siemensTag.DB_Offset, siemensTag.Length); break; case SiemensCycleReadMode.ControlBlock: if (siemensTag.Type == TagType.C) { string key = ""; if (group is SiemensTagGroup) { key = (group as SiemensTagGroup).Name; } else if (group is SiemensSubTagGroup) { SiemensSubTagGroup subGroup = group as SiemensSubTagGroup; key = $"{subGroup.Parent.Name}.{subGroup.Prefix}"; } PLCDBBlock block = ControlBlock[key]; if (block == null) { block = new PLCDBBlock(); ControlBlock.Add(key, block); } block.Add(siemensTag.DB_Offset, siemensTag.Length); } break; } }
protected override void ExtenderConstructor() { targetType = TargetType.None; staminaCost = 2; addedStipulationCard = new FullBlock(); name = "Take Cover"; description = "Gain full block"; image = SpriteBase.mainSpriteBase.cover; }
void Start() { FullBlock.SetActive(false); CrackedBlock.SetActive(true); hitCount++; }
protected override void ExtenderConstructor() { targetType = TargetType.None; ammoCost = 1; staminaCost = 1; addedStipulationCard = new FullBlock(); name = "Stay Low"; description = "Gain full block"; image = SpriteBase.mainSpriteBase.restSprite; }
/// <summary> /// Maakt de blok aan /// </summary> /// <param name="id">Afhankelijk van de id zullen we een bepaalde blok aanmaken</param> /// <param name="content">ContentManager object dat we gebruiken om textures te laden</param> /// <returns>De aangemaakt blok</returns> protected override GameObject CreateBlock(int id, ContentManager content) { GameObject b = null; if (id == 1) { b = new DirtBlock(content, "01"); } else if (id == 2) { b = new GrassTopBlock(content, "04"); } else if (id == 3) { b = new GrassRightBLock(content, "08"); } else if (id == 4) { b = new LeftTopCornerBlock(content, "03"); } else if (id == 5) { b = new RightTopCornerBlock(content, "02"); } else if (id == 6) { b = new AcidMudLeftAndBottomBlock(content, "19"); } else if (id == 7) { b = new AcidMudBottomBlock(content, "15"); } else if (id == 8) { b = new AcidMudRightAndBottomBlock(content, "22"); } else if (id == 9) { b = new GrassLeftBlock(content, "07"); } else if (id == 10) { b = new LeftBottomCornerBlock(content, "10"); } else if (id == 11) { b = new RightBottomCornerBlock(content, "09"); } else if (id == 12) { b = new PlatformBlock(content, "plate1"); } else if (id == 13) { b = new BoxFirstVariant(content, "box1"); } else if (id == 14) { b = new BoxSecondVariant(content, "box2"); } else if (id == 15) { b = new Scarecrow(content, "scarecrow"); } else if (id == 16) { b = new Pointer(content, "pointer"); } else if (id == 17) { b = new OrangeTree(content, "tree1"); } else if (id == 18) { b = new YellowTree(content, "tree2"); } else if (id == 19) { b = new MovingBlock(content, "plate1"); } else if (id == 20) { b = new MovingBlock(content, "plate1") { Invert = true } } ; else if (id == 21) { b = new StarCollectable(content, "star"); } else if (id == 22) { b = new BouncingAcidBall(content, "LavaFireballSprite"); } else if (id == 23) { b = new UpUnderBlock(content, "bovenonder"); } else if (id == 24) { b = new LeftOverRoofBlock(content, "linksoverkaping"); } else if (id == 25) { b = new RightOverRoofBlock(content, "rechtsoverkaping"); } else if (id == 26) { b = new UnderBlock(content, "13"); } else if (id == 27) { b = new FullBlock(content, "11"); } else if (id == 30) { b = new GreenGoblin(content, "GreenGoblinSprite"); } else if (id == 31) { b = new Giant(content, "GiantSprite"); } else if (id == 32) { b = new Orc(content, "BlackGoblin"); } else if (id == 33) { b = new BlueGoblin(content, "BlueMonster"); } else if (id == 40) { b = new InvisibleBlock(content, "legeBlok"); } else if (id == 50) { b = new ButtonNextLevel(content, "button"); } return(b); }
/* public class FireSupportStipulation : CharacterStipulationCard { int friendlyArmorGain = 10; public FireSupportStipulation() { SetLastsForRounds(3); name = "Killzone"; image = SpriteBase.mainSpriteBase.armor; description = "For two rounds: all allies gain "+friendlyArmorGain+" armor for every ranged attack played by the character"; } protected override void ExtenderSpecificActivation() { RangedCard.ERangedCardPlayed += EffectTriggered; } void EffectTriggered(CharacterGraphic cardPlayer, RangedCard playedCard) { if (cardPlayer == appliedToCharacter) MissionCharacterManager.main.IncrementAllCharactersResource(CharacterGraphic.Resource.Armor,friendlyArmorGain); } protected override void ExtenderSpecificDeactivation() { RangedCard.ERangedCardPlayed -= EffectTriggered; } }*/ protected override void ExtenderConstructor() { targetType = TargetType.SelectFriendlyOther; staminaCost = 2; addedStipulationCard = new FullBlock(); name = "Fire Support"; description = "Selected friendly gains full block";//"Play a Killzone to the character"; image = SpriteBase.mainSpriteBase.cover; }