domingo, 8 de septiembre de 2013

vvvv

jueves, 29 de marzo de 2012

Package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.geom.ColorTransform; import flash.geom.Matrix; import flash.geom.Rectangle; import flash.text.TextField; import flash.text.TextFieldAutoSize; import net.hires.debug.Stats; [SWF(width = "465", height = "465", frameRate = "30")] public class BlockBreaker extends Sprite { private static const HEIGHT:Number = 465; private static const WIDTH:Number = 465; private var _canvas:BitmapData; private var _blocks:Blocks; private var _fallBlocks:Vector.; private var _balls:Vector.; private var _bar:Bitmap; public function BlockBreaker() { _canvas = new BitmapData(WIDTH, HEIGHT,false,0x000000); addChild(new Bitmap(_canvas)); _blocks = new Blocks(WIDTH, 100); _fallBlocks = new Vector.(); var b:BitmapData = new BitmapData(50, 10, false, 0x00FF00); addChild(_bar = new Bitmap(b)); _bar.y = WIDTH -b.width; var _ball:Particle = new Particle(WIDTH / 2, HEIGHT / 2); _ball.vx = Math.random() *10; _ball.vy = -Math.random() *9 -1; _ball.color = 0xFFFFFF; _balls = new Vector.(); _balls.push(_ball); //var stats:Stats = new Stats(); //stats.y = 200; //addChild(stats); addEventListener(Event.ENTER_FRAME, update); } private function update(e:Event):void { _canvas.lock(); _canvas.colorTransform(_canvas.rect, new ColorTransform (0.9, 0.5, 0.9)); for each(var block:Particle in _blocks.values) { if (block) { _canvas.setPixel(block.x, block.y, block.color); } } var removeBalls:Vector. = new Vector.(); for each(var ball:Particle in _balls) { var bvx:Number = ball.vx; var bvy:Number = ball.vy; var bspeed:Number = Math.sqrt(bvx * bvx + bvy * bvy); var bradius:Number = Math.atan2(bvy, bvx); for (var i:int = 0; i < bspeed;i++) { ball.x += ball.vx/bspeed; ball.y += ball.vy/bspeed; var hitParticle:Particle = _blocks.getParticle(ball.x, ball.y); if(hitParticle) { var removedP:Particle = _blocks.removeParticle(ball.x, ball.y); removedP.vx = Math.cos(bradius+Math.PI*2/(30*Math.random())-15)*3; removedP.vy = 1; removedP.color = hitParticle.color; _fallBlocks.push(removedP); ball.vy = -ball.vy; } if ((ball.x < 0 && ball.vx < 0) || (ball.x > WIDTH && ball.vx > 0)) { ball.vx = -ball.vx; } if (ball.y < 0 && ball.vy < 0) { ball.vy = -ball.vy; } if (ball.y > HEIGHT) { removeBalls.push(ball); } if (_bar.hitTestPoint(ball.x, ball.y)) { ball.vy = -Math.abs(ball.vy); } _canvas.setPixel(ball.x, ball.y, ball.color); } } removeBalls.forEach(function(b:Particle, ...args):void { var index:int = _balls.indexOf(b); if (index != -1) { _balls.splice(index, 1); } }); var removeFallBs:Vector. = new Vector.(); _fallBlocks.forEach(function(fallP:Particle, ...args):void { fallP.vy += 0.1; fallP.x += fallP.vx; fallP.y += fallP.vy; _canvas.setPixel(fallP.x, fallP.y, fallP.color); if (_bar.hitTestPoint(fallP.x,fallP.y)) { var newball:Particle = new Particle(fallP.x,fallP.y); newball.vx = Math.random() * 10; newball.vy = Math.random() * 9 + 1; newball.color = fallP.color; _balls.push(newball); removeFallBs.push(fallP); }else if (fallP.y > HEIGHT) { removeFallBs.push(fallP); } }); removeFallBs.forEach(function(b:Particle,...args):void{ var index:int = _fallBlocks.indexOf(b); if (index != -1) { _fallBlocks.splice(index, 1); } }); _bar.x = stage.mouseX; _canvas.unlock(); if (_blocks.count == 0) { removeEventListener(Event.ENTER_FRAME, update); var clearTF:TextField = new TextField(); clearTF.text = "CLEAR!\nおめでと"; clearTF.textColor = 0xFFFFFF; clearTF.autoSize = TextFieldAutoSize.LEFT; _canvas.draw(clearTF,new Matrix(5,0,0,5,WIDTH/2-clearTF.width*5/2,HEIGHT/2-clearTF.height*5/2)); } } } } import frocessing.color.ColorHSV; class Blocks { public function get count():int { return _count;} private var _count:int; public function get width():Number { return _width; } private var _width:Number; public function get height():Number { return _height; } private var _height:Number; public var values:Vector.; function Blocks(width:Number,height:Number) { _width = width; _height = height; _count = width * height; values = new Vector.(width * height, false); var c:ColorHSV = new ColorHSV(); for (var i:int = 0; i < _width; i++) { c.h = 360 * i / _width; for (var j:int = 0 ; j < _height; j++ ) { var p:Particle = new Particle(i, j); p.color = c.value; values[i + j * _width] = p; } } } public function getParticle(x:int, y:int):Particle { var index:int = x + y * _width; if (index >= values.length || index < 0) { return null; } return values[x + y * _width]; } public function removeParticle(x:int, y:int):Particle { var p:Particle = values[x + y * _width]; if (p) { _count--; values[x + y * _width] = undefined; } return p; } } class Particle { public var x:Number; public var y:Number; public var vx:Number = 0; public var vy:Number = 0; public var color:uint; public function Particle(x:Number=0,y:Number=0 ) { this.x = x; this.y = y; } }

miércoles, 29 de febrero de 2012

Twtest

viernes, 30 de diciembre de 2011

Test

Valanthe Liadon - (14 Points) in Statblock Format
VALANTHE LIADON CR 4
Male Elf (Lich) Wizard 3
LE Medium undead (elf, elf)
Init +2; Senses Darkvision (60 ft.), Low-light, Perception +17,
Aura Fear Aura (60 ft., DC 13),
DEFENSE
AC 18, touch 12, flat-footed 16 (+2 Dex, +5 natural, +1 , )
hp 20 (3d6)+6
Fort +3, Ref +3, Will +4, +2 vs. enchantment spells and effects
Defensive Abilities Channel Resistance +4,
DR 15/magic and bludgeoning
Immunities Ability Drain, Cold, Death Effects, Death from Massive Damage, Disease, Electricity, Energy Drain, Exhaustion, Fatigue, Mind-Affecting Effects, Nonlethal Damage, Paralysis, Poison, Sleep, Stunning,
OFFENSE
Speed 30 ft.
Melee touch +1 (1d8+1)
Space 5 ft.; Reach 5 ft.
Special Attacks Fear Aura (60 ft., DC 13), Paralyzing Touch (DC 13),
Prepared Spells Prepared Spell List
Wizard (CL 3rd):
2nd - flaming sphere (2) (DC 16)
1st - burning hands (DC 15) , mage armor (DC 15) , magic missile
0th - acid splash , bleed (DC 14) , ghost sound (DC 14) , ray of frost
STATISTICS
Str 10, Dex 15, Con *, Int 19, Wis 13, Cha 15
Base Atk +1; CMB +1; CMD 13
Feats Combat Casting, Craft Wondrous Item, Scribe Scroll
Skills Acrobatics +2, Appraise +4, Bluff +2, Craft (Untrained) +4, Diplomacy +2, Disguise +2, Escape Artist +2, Fly +8, Heal +2, Intimidate +8, Perception +17, Perform (Untrained) +2, Ride +2, Sense Motive +15, Stealth +16, Survival +1,
Languages Common, Elven
Special Qualities Arcane Bond, Cantrips, Elven Immunities, Elven Magic, Keen Senses, Rejuvenation, Weapon Familiarity,
Possessions bracers of armor +1; brooch of shielding; necklace of fireballs i; pearl of power (1st level); spellbook (wizard's/blank);
Spellbook (Wizard's/Blank)

SPECIAL ABILITIES

Arcane Bond (Su) At 1st level, wizards form a powerful bond with an object, as a bonded object, or a creature, as a familiar. Once a wizard makes this choice, it is permanent and cannot be changed.

Cantrips You can prepare a number of cantrips, or 0-level spells, each day. These spells are cast like any other spell, but they are not expended when cast and may be used again. You can prepare a cantrip from a prohibited school, but it uses up two of your available slots.

Channel Resistance (Ex) You are less easily affected by clerics or paladins. You add +4 to saves made to resist the effects of channel energy, including effects that rely on the use of channel energy.

Elven Immunities (Ex) Elves are immune to magic sleep effects and get a +2 racial saving throw bonus against enchantment spells and effects.

Elven Magic (Ex) Elves receive a +2 racial bonus on caster level checks made to overcome spell resistance. In addition, elves receive a +2 racial bonus on Spellcraft skill checks made to identify the properties of magic items.

Fear Aura (Su) Creatures of less than 5 HD in a 60-foot radius that look at the lich must succeed on a Will save or become frightened. Creatures with 5 HD or more must succeed at a Will save or be shaken for a number of rounds equal to the lich's Hit Dice. A creature that successfully saves cannot be affected again by the same lich's aura for 24 hours. This is a mind-affecting fear effect.

Immunity to Ability Drain (Ex) You are immune to ability drain attacks.

Immunity to Cold (Ex) You never take cold damage.

Immunity to Death Effects (Ex) You are never subject to death effects.

Immunity to Death from Massive Damage (Ex) You are not at risk of death from massive damage.

Immunity to Disease (Ex) You are never subject to disease effects.

Immunity to Electricity (Ex) You never take electricity damage.

Immunity to Energy Drain (Ex) You are immune to energy drain attacks.

Immunity to Exhaustion (Ex) You can never be exhausted.

Immunity to Fatigue (Ex) You can never be fatigued.

Immunity to Mind-Affecting Effects (Ex) You are never affected by mind-affecting effects (charms, compulsions, phantasms, patterns, and morale effects).

Immunity to Nonlethal Damage (Ex) You are never subject to nonlethal damage.

Immunity to Paralysis (Ex) You can never be paralyzed.

Immunity to Poison (Ex) You never take poison damage.

Immunity to Sleep (Ex) You are never subject to sleep effects.

Immunity to Stunning (Ex) You are never subject to stunning.

Keen Senses (Ex) Elves receive a +2 bonus on Perception skill checks.

Paralyzing Touch (Su) Any living creature a lich hits with its touch attack must succeed on a Fortitude save or be permanently paralyzed. Remove paralysis or any spell that can remove a curse can free the victim (see the bestow curse spell description, DC 13). The effect cannot be dispelled. Anyone paralyzed by a lich seems dead, though a DC 20 Perception check or a DC 15 Heal check reveals that the victim is still alive.

Rejuvenation (Su) When a lich is destroyed, its phylactery (which is generally hidden by the lich in a safe place far from where it chooses to dwell) immediately begins to rebuild the undead spellcaster's body nearby. This process takes 1d10 days--if the body is destroyed before that time passes, the phylactery merely starts the process anew. After this time passes, the lich wakens fully healed (albeit without any gear it left behind on its old body), usually with a burning need for revenge against those who previously destroyed it.

Weapon Familiarity (Ex) Elves are proficient with longbows (including composite longbows), longswords, rapiers, and shortbows (including composite shortbows), and treat any weapon with the word "elven" in its name as a martial weapon.