1441
Forum Games and Roleplaying / Re: Picture Fight
« on: December 29, 2009, 02:24:02 pm »Spoiler (click to show/hide)
March 6, 2024: Dwarf Fortress 50.12 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
So the really stuffy looking old professor is to be feared, as he can break every bone in your body, while others would just kill you?
And West Africa is more or less antipodal to that Wellington mine 'rumour', and thus out of range (with or without fuelpods).
package conversion;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.MemoryImageSource;
import java.awt.image.PixelGrabber;
public abstract class TextureMixer {
private static short baseR, baseG, baseB;
private static PixelGrabber grabber;
private static Image texture;
private static int[] pixelList;
private static int[][] pixelArrayR, pixelArrayG, pixelArrayB, pixelArrayA;
private static int width, height;
public static Image mixTexture(String filename, int lightR, int lightG, int lightB, int darkR, int darkG, int darkB){
// Testcode
// long m1 = System.currentTimeMillis();
width = 16;
height = 16;
texture = Toolkit.getDefaultToolkit().getImage("src/textures/" + filename + ".png");;
pixelList = new int[width * height];
pixelArrayA = new int[width][height];
pixelArrayR = new int[width][height];
pixelArrayG = new int[width][height];
pixelArrayB = new int[width][height];
// Magenta = 255,0,255.
baseR = 255;
baseG = 0;
baseB = 255;
grabber = new PixelGrabber(texture, 0, 0, width, height, pixelList, 0, width);
grabber.startGrabbing();
// Puts all pixels from the texture in a list
try {
grabber.startGrabbing();
while(!grabber.grabPixels()){
}
} catch (InterruptedException e) {
System.out.println("src/worldModel/TerrainType/convertImage: " + e);
}
// Converts the hex list to 4 'readable' lists (RGB and alpha)
for(int i = 0; i < width; i++){
for(int j = 0; j < height; j++){
int pixel = pixelList[i + (j*width)];
pixelArrayA[i][j] = (pixel >> 24) & 0xFF;
pixelArrayR[i][j] = (pixel >> 16) & 0xFF;
pixelArrayG[i][j] = (pixel >> 8) & 0xFF;
pixelArrayB[i][j] = (pixel) & 0xFF;
// Converts every pixel with the correct RGB (magenta) to the 'light color'
if(pixelArrayR[i][j] == baseR && pixelArrayG[i][j] == baseG && pixelArrayB[i][j] == baseB){
pixelArrayR[i][j] = lightR;
pixelArrayG[i][j] = lightG;
pixelArrayB[i][j] = lightB;
/*
* Converts every shade of gray to the 'dark color' multiplied by the intensitie of the grayness.
* In other words, black stays black, white becomes the dark color, and everything inbetween
* becomes a darker shade of the 'dark' color.
*/
} else if(pixelArrayR[i][j] == pixelArrayG[i][j] && pixelArrayR[i][j] == pixelArrayB[i][j]) {
pixelArrayR[i][j] = Math.round(darkR * pixelArrayR[i][j]/255);
pixelArrayG[i][j] = Math.round(darkG * pixelArrayR[i][j]/255);
pixelArrayB[i][j] = Math.round(darkB * pixelArrayR[i][j]/255);
}
}
}
// Converts the 4 human-readable lists (notice the alpha hasn't changed) back to the hex list
int[] pixelList = new int[width * height];
for(int i = 0;i < width; i++){
for(int j = 0;j < height; j++){
pixelList[i + (j*width)] = ((pixelArrayA[i][j] << 24)& 0xFF000000)
| ((pixelArrayR[i][j] << 16) & 0x00FF0000)
| ((pixelArrayG[i][j] << 8) & 0x0000FF00)
| ((pixelArrayB[i][j]) & 0x000000FF);
}
}
// Testcode
// long m2 = System.currentTimeMillis();
// System.out.println("Duration: " + (m2 - m1));
return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(width, height, pixelList, 0, width));
}
}
So basically, you could measure a magic user's power by their 'finesse', so to speak?
I take it then that mages have really buff 'magic muscles'?
By that, I mean that an experienced practitioner will have more stamina that a newbie?
Does this mean that using magic makes you tired, and you have to recuperate by eating and sleeping?
I believe it was more of an exhaustion thing than hunger in the books, since each action was supposed to take as much energy as performing it under ideal circumstances. There were a lot of ways to sorta cheat the system, since you could run a rock through someone's skull with relative ease. It was also reminiscent of programming - you had to "encode" your spells with kill commands so they wouldn't run forever.
Is life energy finite, and is there a standard amount? I.E. if there is a basic measurement system, like lifting a certain weight to 3 feet in the air from a foot away is 1 Energy, will you be able to accurately gauge your magic using for your lifetime?