Difference between pages "Look Out" and "MediaWiki:Common.js"

From Infinity
(Difference between pages)
Jump to: navigation, search
(Created page with "{{section-common-skills}} {{n4only}} {{n4list}} This Skill allows the user to warn all allies of imminent danger so that they can turn to face new threats. {{skillbox |blac...")
 
 
Line 1: Line 1:
{{section-common-skills}}
+
/* Any JavaScript here will be loaded for all users on every page load. */
  
  
{{n4only}}
+
/* Cookie consent */
{{n4list}}
 
This Skill allows the user to warn all allies of imminent danger so that they can turn to face new threats.
 
  
{{skillbox |black| LOOK OUT! | }}
+
!function(){var i,r,o;i="__tcfapiLocator",r=[],(o=window.frames[i])||(function e(){var t=window.document,a=!!o;if(!a)if(t.body){var n=t.createElement("iframe");n.style.cssText="display:none",n.name=i,t.body.appendChild(n)}else setTimeout(e,5);return!a}(),window.__tcfapi=function(){for(var e,t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];if(!t.length)return r;if("setGdprApplies"===t[0])3<t.length&&2===parseInt(t[1],10)&&"boolean"==typeof t[3]&&(e=t[3],"function"==typeof t[2]&&t[2]("set",!0));else if("ping"===t[0]){var n={gdprApplies:e,cmpLoaded:!1,cmpStatus:"stubCMP",apiVersion:2};"function"==typeof t[2]&&t[2](n,!0)}else r.push(t)},window.addEventListener("message",function(n){var i="string"==typeof n.data,e={};try{e=i?JSON.parse(n.data):n.data}catch(e){}var r=e.__tcfapiCall;r&&window.__tcfapi(r.command,r.version,function(e,t){var a={__tcfapiReturn:{returnValue:e,success:t,callId:r.callId}};i&&(a=JSON.stringify(a)),n.source.postMessage(a,"*")},r.parameter)},!1))}();
{{skill-label | No Roll }}
+
!function(){var i,n,s;i="__uspapiLocator",n=[],(s=window.frames[i])||(function a(){var e=window.document,n=!!s;if(!s)if(e.body){var t=e.createElement("iframe");t.style.cssText="display:none",t.name=i,e.body.appendChild(t)}else setTimeout(a,5);return!n}(),window.__uspapi=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];if(!a.length)return n;"ping"===a[0]?"function"==typeof a[2]&&a[2]({cmpLoaded:!1,cmpStatus:"stubCMP"},!0):n.push(a)},window.addEventListener("message",function(t){var i="string"==typeof t.data,a={};try{a=i?JSON.parse(t.data):t.data}catch(a){}var s=a.__uspapiCall;s&&window.__uspapi(s.command,s.version,function(a,e){var n={__uspapiReturn:{returnValue:a,success:e,callId:s.callId}};i&&(n=JSON.stringify(n)),t.source.postMessage(n,"*")},s.parameter)},!1))}();
{{requirements}}
 
* The user must have [[LoF]] to an opponent's Trooper or Marker who declares or executes an Order.
 
{{effects}}
 
* Allows all other Troopers of the same player to modify their LoF without displacing, if the player so chooses. '''This will be considered as if the Troopers modifying their LoF had declared an ARO'''.  
 
* This modification to the LoF is made through a Normal or Face to Face [[Dodge]] (PH-3) Roll. The Face to Face Roll is only made in case that the alerted Trooper is the Active Trooper's target.
 
* The alerted Troopers may perform the Dodge (PH-3) Roll as long as they had not previously declared any other ARO.
 
* The Reactive Player must indicate which Troopers will modify their LoF after declaring their Look Out! ARO.
 
* All the other Troopers' Dodge (PH-3) Rolls will be made in the same Order as the Trooper using the Look Out! ARO.
 
  
 +
async src='https://cmp.uniconsent.com/v2/a635eb8630/cmp.js'
  
{{greybox-start | Example of Look Out! }}
 
During his Reactive Turn, Fusilier A gains LoF to a Kappa Unit that has declared Move as the first Skill of the Order, which allows him to approach Fusilier B. As Fusilier B is looking the other way, the Kappa is outside his Line of Fire and Zone of Control.
 
  
Since the Kappa Unit is too far from Fusilier A for him to shoot effectively, Fusilier A decides to declare the Look Out! ARO and the Reactive Player indicates that Fusilier B will make a Dodge (PH-3) Roll as ARO because he is alerted.
 
  
The Kappa Unit declares BS Attack against Fusilier B. Thanks to Look Out!, Fusilier B may face his Dodge (PH-3) Roll. If the Fusilier wins the Face to Face Roll, in addition to avoiding the Attack, he may turn around to face the Kappa Unit, if he wishes so. In that case, in the next Order that the Kappa Unit declares, Fusilier B will already have LoF to react by declaring, for example, BS Attack against his enemy.
 
{{greybox-end}}
 
  
 +
/* The main toggle function moved here. */
  
{{n4end}}
+
function toggleN4(showN4) {
 +
/*  alert("clicked! " +showN4); */
 +
    if (showN4=="true") {
 +
        $(".n4").show(300);
 +
        $(".n4list").show(300);
 +
        $(".n4inline").show(300);
 +
        $(".c1hide").hide(300);
 +
        setCookie("showN4", "true", 30);
 +
        var user=getCookie("showN4");
 +
/*      alert("Saved cookie: " + user); */
 +
        var ele = document.getElementsByClassName("c1strike");
 +
        for(var i=0;i<ele.length;i++){
 +
            ele[i].style.setProperty("text-decoration", "line-through");
 +
        }
 +
    } else {
 +
        $(".n4").hide(300);
 +
        $(".n4list").hide(300);
 +
        $(".n4inline").hide(300);
 +
        $(".c1hide").show(300);
 +
        setCookie("showN4", "false", 30);
 +
        var user=getCookie("showN4");
 +
/*      alert("Saved cookie: " + user); */
 +
        var ele = document.getElementsByClassName("c1strike");
 +
        for(var i=0;i<ele.length;i++){
 +
            ele[i].style.setProperty("text-decoration", "");
 +
        }
 +
    }
 +
}
  
  
 +
function forceN4() {
 +
/*  alert("clicked! " +showN4); */
 +
        setCookie("showN4", "true", 30);
 +
        $(".n4").show(0);
 +
        $(".n4list").show(0);
 +
        $(".n4inline").show(0);
 +
        $(".c1hide").hide(0);
 +
        $('#gametoggle').attr('checked', true);
 +
        var ele = document.getElementsByClassName("c1strike");
 +
        for(var i=0;i<ele.length;i++){
 +
            ele[i].style.setProperty("text-decoration", "line-through");
 +
        }
 +
 +
}
  
[[Category:Common Skills]]
+
 
 +
function forceC1() {
 +
/*  alert("clicked! " +showN4); */
 +
        setCookie("showN4", "false", 30);
 +
        $('#gametoggle').attr('checked', false);
 +
      $(".n4").hide(0);
 +
      $(".n4list").hide(0);
 +
        $(".n4inline").hide(0);
 +
        $(".c1hide").show(0);
 +
        var ele = document.getElementsByClassName("c1strike");
 +
        for(var i=0;i<ele.length;i++){
 +
            ele[i].style.setProperty("text-decoration", "");
 +
        }
 +
}
 +
 
 +
 
 +
 
 +
/* This code creates the N4 reveal slider, and what happens when you click on it. */
 +
 
 +
$(document).ready(function(){
 +
    var doShow=getCookie("showN4");
 +
    if (doShow =="true") {
 +
        forceN4()
 +
    }
 +
    var showFromURL=getParameterByName('version');
 +
    if (showFromURL =="n4") {
 +
        forceN4()
 +
        setCookie("showN4", "true", 30);
 +
    }
 +
    if (showFromURL =="c1") {
 +
        forceC1()
 +
        setCookie("showN4", "false", 30);
 +
    }
 +
 
 +
          $(".n4toggle").hide();
 +
            $("#gametoggle").click(function(){
 +
                if ($("#gametoggle").is(":checked")) {
 +
                    toggleN4("true")
 +
              } else {
 +
                    toggleN4("false")
 +
                }
 +
            });
 +
        });
 +
 
 +
 
 +
$(function () {
 +
$('#n4gametoggle').html("<span class='gamesliderlabel'>Show full N4 rules: </span><label class='switch' > <input type='checkbox' id='gametoggle' ><span class='slider round' ></span></label>");
 +
}());
 +
 
 +
 
 +
 
 +
 
 +
/* URL parameter stuff. */
 +
 
 +
function getParameterByName(name, url) {
 +
    if (!url) url = window.location.href;
 +
    name = name.replace(/[\[\]]/g, '\\$&');
 +
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
 +
        results = regex.exec(url);
 +
    if (!results) return null;
 +
    if (!results[2]) return '';
 +
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
 +
}
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
/* Cookie stuff. */
 +
 
 +
function setCookie(cname, cvalue, exdays) {
 +
  var d = new Date();
 +
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
 +
  var expires = "expires="+ d.toUTCString();
 +
  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
 +
}
 +
 
 +
function getCookie(cname) {
 +
  var name = cname + "=";
 +
  var decodedCookie = decodeURIComponent(document.cookie);
 +
  var ca = decodedCookie.split(';');
 +
  for(var i = 0; i <ca.length; i++) {
 +
    var c = ca[i];
 +
    while (c.charAt(0) == ' ') {
 +
      c = c.substring(1);
 +
    }
 +
    if (c.indexOf(name) == 0) {
 +
      return c.substring(name.length, c.length);
 +
    }
 +
  }
 +
  return "";
 +
}

Revision as of 13:22, 11 June 2021

/* Any JavaScript here will be loaded for all users on every page load. */


/* Cookie consent */

!function(){var i,r,o;i="__tcfapiLocator",r=[],(o=window.frames[i])||(function e(){var t=window.document,a=!!o;if(!a)if(t.body){var n=t.createElement("iframe");n.style.cssText="display:none",n.name=i,t.body.appendChild(n)}else setTimeout(e,5);return!a}(),window.__tcfapi=function(){for(var e,t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];if(!t.length)return r;if("setGdprApplies"===t[0])3<t.length&&2===parseInt(t[1],10)&&"boolean"==typeof t[3]&&(e=t[3],"function"==typeof t[2]&&t[2]("set",!0));else if("ping"===t[0]){var n={gdprApplies:e,cmpLoaded:!1,cmpStatus:"stubCMP",apiVersion:2};"function"==typeof t[2]&&t[2](n,!0)}else r.push(t)},window.addEventListener("message",function(n){var i="string"==typeof n.data,e={};try{e=i?JSON.parse(n.data):n.data}catch(e){}var r=e.__tcfapiCall;r&&window.__tcfapi(r.command,r.version,function(e,t){var a={__tcfapiReturn:{returnValue:e,success:t,callId:r.callId}};i&&(a=JSON.stringify(a)),n.source.postMessage(a,"*")},r.parameter)},!1))}();
!function(){var i,n,s;i="__uspapiLocator",n=[],(s=window.frames[i])||(function a(){var e=window.document,n=!!s;if(!s)if(e.body){var t=e.createElement("iframe");t.style.cssText="display:none",t.name=i,e.body.appendChild(t)}else setTimeout(a,5);return!n}(),window.__uspapi=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];if(!a.length)return n;"ping"===a[0]?"function"==typeof a[2]&&a[2]({cmpLoaded:!1,cmpStatus:"stubCMP"},!0):n.push(a)},window.addEventListener("message",function(t){var i="string"==typeof t.data,a={};try{a=i?JSON.parse(t.data):t.data}catch(a){}var s=a.__uspapiCall;s&&window.__uspapi(s.command,s.version,function(a,e){var n={__uspapiReturn:{returnValue:a,success:e,callId:s.callId}};i&&(n=JSON.stringify(n)),t.source.postMessage(n,"*")},s.parameter)},!1))}();

async src='https://cmp.uniconsent.com/v2/a635eb8630/cmp.js'




/* The main toggle function moved here. */

function toggleN4(showN4) {
/*   alert("clicked! " +showN4); */
    if (showN4=="true") {
        $(".n4").show(300);
        $(".n4list").show(300);
        $(".n4inline").show(300);
        $(".c1hide").hide(300);
        setCookie("showN4", "true", 30);
        var user=getCookie("showN4");
 /*       alert("Saved cookie: " + user); */
        var ele = document.getElementsByClassName("c1strike");
        for(var i=0;i<ele.length;i++){
            ele[i].style.setProperty("text-decoration", "line-through");
        }
    } else {
        $(".n4").hide(300);
        $(".n4list").hide(300);
        $(".n4inline").hide(300);
        $(".c1hide").show(300);
        setCookie("showN4", "false", 30);
        var user=getCookie("showN4");
 /*       alert("Saved cookie: " + user); */
        var ele = document.getElementsByClassName("c1strike");
        for(var i=0;i<ele.length;i++){
            ele[i].style.setProperty("text-decoration", "");
        }
    }
}


function forceN4() {
/*   alert("clicked! " +showN4); */
        setCookie("showN4", "true", 30);
        $(".n4").show(0);
        $(".n4list").show(0);
        $(".n4inline").show(0);
        $(".c1hide").hide(0);
        $('#gametoggle').attr('checked', true);
        var ele = document.getElementsByClassName("c1strike");
        for(var i=0;i<ele.length;i++){
            ele[i].style.setProperty("text-decoration", "line-through");
        }
 
}


function forceC1() {
/*   alert("clicked! " +showN4); */
        setCookie("showN4", "false", 30);
        $('#gametoggle').attr('checked', false);
       $(".n4").hide(0);
       $(".n4list").hide(0);
        $(".n4inline").hide(0);
        $(".c1hide").show(0);
        var ele = document.getElementsByClassName("c1strike");
        for(var i=0;i<ele.length;i++){
            ele[i].style.setProperty("text-decoration", "");
        }
}



/* This code creates the N4 reveal slider, and what happens when you click on it. */

$(document).ready(function(){
    var doShow=getCookie("showN4");
    if (doShow =="true") {
        forceN4()
    }
    var showFromURL=getParameterByName('version');
    if (showFromURL =="n4") {
        forceN4()
        setCookie("showN4", "true", 30);
    }
    if (showFromURL =="c1") {
        forceC1()
        setCookie("showN4", "false", 30);
    }

          $(".n4toggle").hide();
            $("#gametoggle").click(function(){
                if ($("#gametoggle").is(":checked")) {
                    toggleN4("true")
               } else {
                    toggleN4("false")
                }
            });
        });


$(function () {
	$('#n4gametoggle').html("<span class='gamesliderlabel'>Show full N4 rules: </span><label class='switch' > <input type='checkbox' id='gametoggle' ><span class='slider round' ></span></label>");
}());




/* URL parameter stuff. */

function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, '\\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
}






/* Cookie stuff. */

function setCookie(cname, cvalue, exdays) {
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires="+ d.toUTCString();
  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}

function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}