TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Making a unit attack alone

    Scheduled Pinned Locked Moved Map Making
    3 Posts 2 Posters 1.7k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RogerCooperR Offline
      RogerCooper
      last edited by

      I am working on mod for the game "East & West" that has an atomic bomb unit. Under the rules, atomic bombs can't attack with other units. I don't think I can prevent that from happening but I can discourage by penalizing units attacking with the bomb and enhancing the defender.

      Here is my code

      <attachment name="unitAttachment" attachTo="fusion_bomb" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="6"/>
      <option name="attack" value="6"/>
      <option name="attackRolls" value="10"/>
      <option name="defense" value="0"/>
      <option name="attackAA" value="0"/>
      <option name="offensiveAttackAA" value="1"/>
      <option name="offensiveAttackAAmaxDieSides" value="6"/>
      <option name="maxAAattacks" value="-1"/>
      <option name="isAAforCombatOnly" value="true"/>
      <option name="typeAA" value="nuclearBlast"/>
      <option name="targetsAA" value="fighter:bomber"/>
      <option name="isAir" value="true"/>
      <option name="canAirBattle" value="false"/>
      <option name="isSuicideOnAttack" value="true"/>
      </attachment>
      
      <attachment name="supportAttachmentAtomicInterference1" attachTo="fission_bomb" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
      			<option name="unitType" value="infantry:armor:heavy_armor:fighter:bomber:battleship:cruiser:carrier:submarine:self-propelled_artillery"/>
      			<option name="faction" value="allied"/>
      			<option name="side" value="offence"/>
      			<option name="dice" value="strength"/>
      			<option name="bonus" value="-6"/>
      			<option name="number" value="99"/>
      			<option name="bonusType" value="nuclear"/>
            <option name="players" value="Soviet_Union:Britain:Western_Europe:United_States"/>
      </attachment>
      
      <attachment name="supportAttachmentAtomicInterference2" attachTo="fission_bomb" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
      			<option name="unitType" value="infantry:armor:heavy_armor:fighter:bomber:battleship:cruiser:carrier:submarine:self-propelled_artillery"/>
      			<option name="faction" value="enemy"/>
      			<option name="side" value="offence"/>
      			<option name="dice" value="strength"/>
      			<option name="bonus" value="6"/>
      			<option name="number" value="99"/>
      			<option name="bonusType" value="nuclear"/>
            <option name="players" value="Soviet_Union:Britain:Western_Europe:United_States"/>
      </attachment>
      
      The first two attachments work properly. The last one doesn't seem to have an effect. I am doing anything wrong?
      
      W 1 Reply Last reply Reply Quote 3
      • W Offline
        wc_sumpton @RogerCooper
        last edited by wc_sumpton

        @rogercooper

        I'm trying to understand what you are saying compared to what is being presented. Why is there AA options for the fusion_bomb? What I'm not seeing is any options for <canNotTarget> or <canNotBeTargetedBy>, so does the fusion_bomb have the ability to attack fighter:bomber twice during a combat round? Once during the AA combat and again during normal combat?

        As to the <supportAttachment>s, the first one reads; While the fusion_bomb is on offence for the listed players, it can apply 99 "nuclear" bonuses of a -6 value to the list of allied units which can receive the "nuclear" bonus only once.
        The second one reads; While the fusion_bomb is on offence for the listed players, it can apply 99 "nuclear" bonuses of a 6 value to the list of enemy units which can receive the "nuclear" bonus only once.

        The problem is with "isSuicideOnAttack". The fusion_bomb will be removed after its attack roll so there will be no bonuses given to enemy units because the fusion_bomb will not be there.

        Cheers...

        RogerCooperR 1 Reply Last reply Reply Quote 2
        • RogerCooperR Offline
          RogerCooper @wc_sumpton
          last edited by

          @wc_sumpton said in Making a unit attack alone:

          The problem is with "isSuicideOnAttack". The fusion_bomb will be removed after its attack roll so there will be no bonuses given to enemy units because the fusion_bomb will not be there.

          Thanks for the help. The first support attachment should be good enough.

          The AA attack reflects an EMP attack effect from the "East & West" game.

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums