Skip to content

Instantly share code, notes, and snippets.

@Jorshasaur
Jorshasaur / npc.macro
Last active June 16, 2020 16:18
NPC_Starship_Combat
&{template:default} {{name=@{selected|token_name}}} {{Crew Roll=[[1d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20]] [[1d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20]]}} {{Extra Crew Dice=[[ ?{Extra Crew Dice (1 Threat Each)|0}d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20 ]] }} {{—}} {{Fire Weapon=[[ 1d20<[[ @{ship_weapons} + @{ship_security} ]]cs<@{ship_security}cf20 ]]}} {{Cannon Damage= [[ [[ @{ship_security} + @{ship_scale} + 2 ]]t[Challenge-Dice] ]] }} {{Bank Damage= [[ [[ @{ship_security} + @{ship_scale} + 1 ]]t[Challenge-Dice] ]] }} {{Array Damage= [[ [[ @{ship_security} + @{ship_scale} ]]t[Challenge-Dice] ]] }} {{Torpedo Damage= [[ [[ @{ship_security} + 3 ]]t[Challenge-Dice] ]] }} {{—-}} {{Evasive Action= [[ 1d20<[[ @{ship_structure} + @{ship_conn} ]]cs<@{ship_conn}cf20 ]]}}{{Attack Pattern=[[ 1d20<[[ @{ship_weapons} + @{ship_conn} ]]cs<@{ship_conn}cf20 ]]}} {{Scan for Weakness=[[ 1d20<[[ @{ship_sensors} + @{ship_security} ]]cs<@{ship_security}cf20 ]]}} {{Regen Sh
@Jorshasaur
Jorshasaur / NPC_Fire_Weapons
Last active June 16, 2020 16:18
More Roll20 Macros
// This one uses the selected token's character sheet and pulls the stats to make a combat roll. It also asks if you wanna spend more power, and it decrements the ship's power at the end
&{template:default} {{name=@{selected|token_name} - Fire Disruptor Cannon}} {{Difficulty= 2 + 1 per band outside of Close}} {{ Normal Roll=[[ 1d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20 ]] [[ 1d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20 ]] }} {{ Extra Roll= [[ 1d20<[[ @{attribute} + @{discipline} ]]cs<@{discipline}cf20 ]] }} {{ Ship Assist= [[ 1d20<[[ @{ship_weapons} + @{ship_security} ]]cs<@{ship_security}cf20 ]] }} {{Damage Roll= [[ [[ @{ship_security} + @{ship_scale} + 2 ]]t[Challenge-Dice] ]] }} {{Extra Damage =?{Extra Damage (extra power spent) |0} }}{{Qualities=Vicious 1}}
!setattr --sel --mute --mod --power|-?{Amount of power spent|1}
@Jorshasaur
Jorshasaur / Attack
Created June 15, 2018 23:58
Macros for Roll 20 - Fleet Engagements
&{template:default} {{name=@{selected|token_name} }} {{Attack Roll= [[ @{attack}t[Challenge-Dice] ]] }}
!setattr --sel --mute --mod --Attack|-1
!roll20AM --play|heavy-phaser|photon
@Jorshasaur
Jorshasaur / good.java
Created November 4, 2017 03:56
Rxjava Subscriber in the right place
return userManager.getMobileApiService().getUserMemberships(userManager.getUser().userId)
.concatMap(this::buildAccounts)
.subscribeOn(appManager.getSubscriber())
.observeOn(appManager.getObserver());
@Jorshasaur
Jorshasaur / bad.java
Created November 4, 2017 03:52
Rxjava Out of Order
return userManager.getMobileApiService().getUserMemberships(userManager.getUser().userId)
.subscribeOn(appManager.getSubscriber())
.observeOn(appManager.getObserver())
.concatMap(this::buildAccounts);
@Jorshasaur
Jorshasaur / dispatcher.coffee
Last active May 23, 2017 02:09
Observer pattern implementation in Angular. This factory dispatches messages to controllers, directives, or other services.
module.directive "someDirectiveDispatcher", (Messenger)->
return{
restrict: "E"
template: "<h1>Test</h1>"
controller: ($scope)->
$scope.elementClickEvent = ()->
Messenger.call Messenger.REFRESH_SOMETHING
}
@Jorshasaur
Jorshasaur / home_controller_decorator.rb
Created May 14, 2013 15:14
Example of how to pull in Taxons using erb
Spree::HomeController.class_eval do
helper 'spree/products'
respond_to :html
def index
@apikey = Settings.api_key
@taxons = Spree::Taxon.all
end
end
@Jorshasaur
Jorshasaur / testgist.js
Created August 4, 2012 18:27
Test Gist
(function(){
return{
init: function(){
console.log("this is just a test!");
}
}